I found a solution! New code is indicated by 'new
vb Code:
Private CountArray As Integer 'Count the Created Object Array Private AllowDrag As Boolean 'Disallow Arrayed object to create other objects 'new Private bLeftMouseClick As Boolean Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single) If AllowDrag = False Then Exit Sub CountArray = CountArray + 1 Load Picture1(CountArray) Picture1(CountArray).Visible = True Picture1(CountArray).Print CountArray Picture1(CountArray).Move (X - Source.Width / 2), (Y - Source.Height / 2) End Sub Private Sub Form_Load() Picture1(0).AutoRedraw = True End Sub Private Sub Picture1_DragOver(Index As Integer, Source As Control, X As Single, Y As Single, State As Integer) If Not Index = 0 Then AllowDrag = False Else AllowDrag = True End If 'new bLeftMouseClick = True End Sub Private Sub Picture1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer) 'new If bLeftMouseClick Then If KeyCode = 46 Then MsgBox (KeyCode) Unload Picture1(Index) End If 'new End If bLeftMouseClick = False End Sub




Reply With Quote