Hello,
I have this code here to create a PictureBox when the user clicks a cmd button.
Here is the code:
VB Code:
Private Sub mnuPopCopy_Click() Dim mobjPicture As PictureBox If shpCrop.Visible = False Then Exit Sub Set mobjPicture = Controls.Add("VB.PictureBox", "Pic") With mobjPicture .Width = intWidth .Height = intHeight .AutoSize = True .AutoRedraw = True .Visible = True .Left = Picture1.Left .Top = Picture1.Top End With mobjPicture.PaintPicture Picture1.Picture, 0, 0, , , intLeft, intTop Clipboard.Clear Clipboard.SetData mobjPicture.Image Picture1.Visible = False shpCrop.Visible = False Set mobjPicture = Nothing 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:
Private Sub mobjPicture_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) MsgBox "YES!" 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




Reply With Quote