You can use the CallByName function to refer to objects using their name as text.
___
For x = 52 To 57
With CallByName(Me, "Label" & x, VbGet)
CallByName(Me, "Label" & (x + 1), VbGet).Left = .Left + .Width
End With
Next x
___
However, recommended method is to use control arrays...
Instead of using Index for this purpose, I would suggest using the Tag property which is more suitable for storing some auxiliary data. The Tag property is not visible in Menu Editor window. You must use the Properties window to initialize Tag property after defining the menu structure.
If you...
>other requirements
I revisited the question. OK, the code needs to be simplified as follows.
___
Dim r As Integer
MSHFlexGrid1.Col = 3
For r = 1 To MSHFlexGrid1.Rows - 1
MSHFlexGrid1.Row = r
If MSHFlexGrid1.Text = cboSearch.Text Then
MSHFlexGrid1.CellBackColor = vbGreen...
First of all, try to indent your code. It makes things a lot easier to read and understand.
I hope you have enabled auto indentation which is turned on by default. If not, you are strongly advised to do so. (Tools>Options>Auto Indent).
When you indent the above code, it looks like the following...
You don't need to pull data from your recordset. Instead, you can use the FlexGrid control to query the data (image path) directly.
Something like this...
Image1.Picture = LoadPicture(MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, N))
Where N is the column number where 'id_photo' field is displayed...
Put the following formula in cell B1.
=MID(A1,FIND(" ",A1)+1,100)
This will extract the email address from cell A1 to cell B1 leaving behind the serial number.
You can copy the formula to following cells in the column. VBA is not needed for such a trivial task.
For further questions related to...
...Double, Amplitude As Double)
Dim N As Long
Const Pi = 3.14159265358979
For N = 0 To UBound(Wave)
Wave(N) = Wave(N) + Amplitude * Sin(2 * Pi * Frequency * N / SampleRate)
Next
End Sub
Private Function Frequency(Hysteresis As Double) As Double
Dim N As Long, Flag As...
Two things.
1. You said you already tried the zero-crossing technique. What problems did you face with that method? If the results are not accurate enough (like getting a frequency higher than actual in result), you should implement the hysteresis filter. It would eliminate noise and low...
...Length
Assuming the event occurs every 100ms, the Length should be typically 2205 if all samples are returned from the last event. (Sample Rate * 0.1s = 2205).
If the zero crossing count is, say 500, then frequency will be calculated as follows.
Sample Rate = 22050
Sample Length (in...
>I can only assume that for some reason VB thinks that the smaller EXE is in fact the same as the main EXE as far as PrevInstance is concerned.
Very strange for me. I have never seen App.PrevInstance fail in the way described above. Can you show the complete initialization code?
>Is there a way...
Yes, I see the effect of fRunmode parameter. In fact, if we change the KeepOriginalFormat property of returned picture to false, using its IPicture interface, the effect is same. The modified code fragment shows this.
Dim pic As IPicture, pb As New PropertyBag
Set pic = PictureFromRawBits(B)...
>I'll repeat, the Picture object holds a BITMAP ... The Handle property ... is in fact an hBitmap.
I never contradicted that. After all, we pass Picture.Handle to Win32 GDI functions expecting an hBitmap all the time.
But both of my statements above were based on my observations.
I just...
>I previously used propertybags and a stream to accumulate the BMP pic because they gave an extra check on the integrity of the network data and were very convenient to program and quick in operation.
If you find property bags so useful for merging data and handshaking information, with ease of...
I have been watching this thread, and other related threads silently for sometime. Main reason being that I have practically no idea how GDI+ stuff works. Had no plans to intervene until strongm's last post rang a bell.
>when we save it to a stream it is just the same as saving it to a file. So...
>If Cdbl(MyDate)>0 And IsDate(MyDate)=True Then
If MyDate is a Date variable, then IsDate(MyDate) will always return True. It is helpful if you are testing a if a variant or string contains a valid date as mentioned above.
Furthermore, CDbl is also not required. You can treat a date variable...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.