[RESOLVED] Using LaVolpe's AlphaImgCtl activeX within a controls array mouse events problem!
I am using LaVolpe's AlphaImgCtl activeX to add .png images to my project. I created at designtime a controls array of AlphaImgCtl. I want to <do something> when the mouse is down on AlphaImgCtl. I used this:
Code:
Private Sub button_MouseDown(Index As Integer, button As Integer, Shift As Integer, X As Single, Y As Single)
button(Index).picture = btnClk.picture
End Sub
'button' is the name of the control that created the array at designtime. 'btnClk' is just another picture.
But when I write the code it won't even show that drop down list of properties, and when I debug and click on the control, it says:
"Compile Error: Array Expected"
What can I do about this? When I use this code in the other mouse events of the AlphaImgCtl activeX such as Mouse_Enter and Mouse_Exit, it works perfectly.. Thank You in advance :)
Re: Using LaVolpe's AlphaImgCtl activeX within a controls array mouse events problem!
The button Integer parameter shadows the button control. Rename the control to something else to avoid name collision.
EDIT
According to Shadowing Form Properties and Controls, you can also qualify the button control with Me.
Re: Using LaVolpe's AlphaImgCtl activeX within a controls array mouse events problem!
Thank you Bonnie West. Renaming the control solved the problem. :)
Re: Using LaVolpe's AlphaImgCtl activeX within a controls array mouse events problem!
You're welcome! You may now mark this thread :check: Resolved!