Results 1 to 4 of 4

Thread: [RESOLVED] Using LaVolpe's AlphaImgCtl activeX within a controls array mouse events problem!

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2013
    Location
    Albania
    Posts
    101

    Resolved [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

  2. #2
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    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)

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2013
    Location
    Albania
    Posts
    101

    Re: Using LaVolpe's AlphaImgCtl activeX within a controls array mouse events problem!

    Thank you Bonnie West. Renaming the control solved the problem.

  4. #4
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    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
  •  



Click Here to Expand Forum to Full Width