S
sevenfoot
how can I make one subroutine to handle events from different objects?
For instance I have six panels that do the same thing when something
is dragged into them, I'd like to have one subroutine to do this
rather than have six.
Private Sub Panel0_DragEnter(ByVal sender
As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles
Panel0.DragEnter
If (e.Data.GetDataPresent(DataFormats.Text))
Then
e.Effect = DragDropEffects.Copy
Else
e.Effect = DragDropEffects.None
End If
End Sub
Private Sub Panel1_DragEnter(ByVal sender As Object, ByVal e
As System.Windows.Forms.DragEventArgs) Handles Panel1.DragEnter
If (e.Data.GetDataPresent(DataFormats.Text))
Then
e.Effect = DragDropEffects.Copy
Else
e.Effect = DragDropEffects.None
End If
End Sub
here's two of the subroutines, the only thing that changes is the name
of the panel.
thanks,
Jason
For instance I have six panels that do the same thing when something
is dragged into them, I'd like to have one subroutine to do this
rather than have six.
Private Sub Panel0_DragEnter(ByVal sender
As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles
Panel0.DragEnter
If (e.Data.GetDataPresent(DataFormats.Text))
Then
e.Effect = DragDropEffects.Copy
Else
e.Effect = DragDropEffects.None
End If
End Sub
Private Sub Panel1_DragEnter(ByVal sender As Object, ByVal e
As System.Windows.Forms.DragEventArgs) Handles Panel1.DragEnter
If (e.Data.GetDataPresent(DataFormats.Text))
Then
e.Effect = DragDropEffects.Copy
Else
e.Effect = DragDropEffects.None
End If
End Sub
here's two of the subroutines, the only thing that changes is the name
of the panel.
thanks,
Jason