G
Guest
I have a form with labels that can be dragged and dropped onto
different regions of the form either individually or in groups. I
signify labels which have been selected by toggling the BorderStyle
between FixedSingle and Fixed3D. Upon a single click the toggle
occurs. Upon a double click I display a simulated tool tip (label)
containing more information about the label selected.
I am using the MouseDown event of the label and am using if conditions
to branch the single and double click logic using e.Clicks. When the
BorderStyle is changed (toggled) on every single click, the double
click will never fire.
I need to find a way around this without introducing a delay equal to
the DoubleClickTime.
I also thought I should post this so Microsoft can add it to their
patch list.
Thanks in advance for any advice you can provide.
Here is a sample of code that will reproduce this "feature".
Private Sub Pallet_MouseDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs)
'// FYI - handler to this event added elsewhere in code
'// closes any open tool tip (not necessary to reproduce bug)
CloselblOverFlow_MouseDown(sender, e)
'// branches based on # of clicks (type check not necessary to
reproduce bug)
If e.Button = MouseButtons.Left And e.Clicks = 1 And
sender.GetType.Equals(GetType(PalletLabel)) Then
Dim lblPallet As PalletLabel = CType(sender, PalletLabel)
'// change BorderStyle of sender
If lblPallet.BorderStyle = BorderStyle.Fixed3D Then
lblPallet.BorderStyle = BorderStyle.FixedSingle
Else
lblPallet.BorderStyle = BorderStyle.Fixed3D
End If
'// iniate drag (not necessary to reproduce bug)
lblPallet.DoDragDrop(sender, DragDropEffects.Move)
ElseIf e.Button = MouseButtons.Left And e.Clicks = 2 Then
'// this code will never execute
Call ShowOverflow(CType(sender, Control))
End If
End Sub
different regions of the form either individually or in groups. I
signify labels which have been selected by toggling the BorderStyle
between FixedSingle and Fixed3D. Upon a single click the toggle
occurs. Upon a double click I display a simulated tool tip (label)
containing more information about the label selected.
I am using the MouseDown event of the label and am using if conditions
to branch the single and double click logic using e.Clicks. When the
BorderStyle is changed (toggled) on every single click, the double
click will never fire.
I need to find a way around this without introducing a delay equal to
the DoubleClickTime.
I also thought I should post this so Microsoft can add it to their
patch list.
Thanks in advance for any advice you can provide.
Here is a sample of code that will reproduce this "feature".
Private Sub Pallet_MouseDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs)
'// FYI - handler to this event added elsewhere in code
'// closes any open tool tip (not necessary to reproduce bug)
CloselblOverFlow_MouseDown(sender, e)
'// branches based on # of clicks (type check not necessary to
reproduce bug)
If e.Button = MouseButtons.Left And e.Clicks = 1 And
sender.GetType.Equals(GetType(PalletLabel)) Then
Dim lblPallet As PalletLabel = CType(sender, PalletLabel)
'// change BorderStyle of sender
If lblPallet.BorderStyle = BorderStyle.Fixed3D Then
lblPallet.BorderStyle = BorderStyle.FixedSingle
Else
lblPallet.BorderStyle = BorderStyle.Fixed3D
End If
'// iniate drag (not necessary to reproduce bug)
lblPallet.DoDragDrop(sender, DragDropEffects.Move)
ElseIf e.Button = MouseButtons.Left And e.Clicks = 2 Then
'// this code will never execute
Call ShowOverflow(CType(sender, Control))
End If
End Sub