|
-
Jun 17th, 2013, 11:55 AM
#1
Thread Starter
Lively Member
[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
-
Jun 17th, 2013, 12:08 PM
#2
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.
Last edited by Bonnie West; Jun 17th, 2013 at 12:19 PM.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
Jun 17th, 2013, 12:49 PM
#3
Thread Starter
Lively Member
Re: Using LaVolpe's AlphaImgCtl activeX within a controls array mouse events problem!
Thank you Bonnie West. Renaming the control solved the problem.
-
Jun 17th, 2013, 01:03 PM
#4
Re: Using LaVolpe's AlphaImgCtl activeX within a controls array mouse events problem!
You're welcome! You may now mark this thread Resolved!
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|