Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DragLeave Event issue.

Status
Not open for further replies.

VB4Life

Programmer
Nov 8, 2008
50
US
Hi all, I have a custom DragLeave event for multiple buttons, on my DragEnter event I change the backcolor(Yellow) of the flowLayoutPanel to show where the item is going to drop, but if they leave this FLP and enter a diff FLP I want the backcolor(of the first one) to change back to the original color. The DragEnter color change works fine, it is not changing the backcolor back when it leaves the draging on any of the FLPs here is my code:(midnightBlue being the original color)

Private Sub FLP_DragLeave(ByVal sender As Object, ByVal e As DragEventArgs)
If e.Data.GetDataPresent("myObject") Then
If e.Effect = DragDropEffects.All Then
Dim flp As FlowLayoutPanel = DirectCast(sender, FlowLayoutPanel)
flp.BackColor = Color.MidnightBlue
End If
End If
End Sub

I do have all the FLPs addhandlers set to this SUB.
Thanks for the help...
 
Ok I feel silly, I double checked the signature and I was wrong, it is EventArgs not DragEventArgs.

DUH MOMENT!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top