Results 1 to 6 of 6

Thread: Mousedown feature on a Pic Box added via controls.add? {RESOLVED}

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member stilekid007's Avatar
    Join Date
    Apr 2005
    Location
    DUDE! I'm your neighbor! HELLO!!!
    Posts
    388

    Resolved Mousedown feature on a Pic Box added via controls.add? {RESOLVED}

    Hello,

    I have this code here to create a PictureBox when the user clicks a cmd button.

    Here is the code:
    VB Code:
    1. Private Sub mnuPopCopy_Click()
    2.    
    3.     Dim mobjPicture As PictureBox
    4.     If shpCrop.Visible = False Then Exit Sub
    5.    
    6.     Set mobjPicture = Controls.Add("VB.PictureBox", "Pic")
    7.  
    8.     With mobjPicture
    9.         .Width = intWidth
    10.         .Height = intHeight
    11.         .AutoSize = True
    12.         .AutoRedraw = True
    13.         .Visible = True
    14.         .Left = Picture1.Left
    15.         .Top = Picture1.Top
    16.     End With
    17.    
    18.     mobjPicture.PaintPicture Picture1.Picture, 0, 0, , , intLeft, intTop
    19.    
    20.     Clipboard.Clear
    21.     Clipboard.SetData mobjPicture.Image
    22.  
    23.     Picture1.Visible = False
    24.  
    25.     shpCrop.Visible = False
    26.     Set mobjPicture = Nothing
    27.    
    28.    
    29. End Sub

    Now what I need to do is get it so that once this picture box is loaded I want it to have this code.

    VB Code:
    1. Private Sub mobjPicture_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    2. MsgBox "YES!"
    3. End Sub

    However even with this code, when I click on the new pic box nothing happens.

    Does anyone know how to fix that?

    Thank you and have a great day!
    Stilekid007
    Last edited by stilekid007; Jun 15th, 2005 at 07:22 AM.

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