I made a menu with dropdown buttons (A, B,C, ...).
If I click on a button and accidentally hover over another button while going down to the submenu, the dropdown button closes.
Is it possible to keep the dropdown button open until something else is clicked on?
Hi Kim,
Sorry for the delay in getting back to you
We are validating your reported query. We will validate and update you in two business days. We appreciate your patience until then.
Regards,
Bagavathi Perumal A
Hi Kim,
Sorry for the delay in getting back to you.
You can cancel the closing of dropdown by setting true to cancel when closereason is AppFocusChange in the closing event of dropdown.
CodeSnippets:
private void DropDown_Closing1(object sender,
System.Windows.Forms.ToolStripDropDownClosingEventArgs e)
{
if(e.CloseReason==System.Windows.Forms.ToolStripDropDownCloseReason.AppFocusChange)
{
e.Cancel = true;
}
}
Regards,
Gokul T.
i converted it to vb.net and put it on my form but is doesn't do anything.
Private Sub ToolStripEx1_CollapsedDropdownClosing(sender As Object, e As ToolStripDropDownClosingEventArgs) Handles ToolStripEx1.CollapsedDropdownClosing
If e.CloseReason = System.Windows.Forms.ToolStripDropDownCloseReason.AppFocusChange Then
e.Cancel = True
End If
End Sub
Hi Kim,
Regards,
Gokul T
Hi Kim,
Regards,
Gokul T
ok, thanks.
what is changed, i don't see any code, how do i apply it to my app ?
Hi Kim,
AddHandler toolStripDropDownButton1.DropDown.Closing, AddressOf DropDown_Closing
Private Sub DropDown_Closing(ByVal sender As Object, ByVal e As Windows.Forms.ToolStripDropDownClosingEventArgs)
If e.CloseReason = Windows.Forms.ToolStripDropDownCloseReason.AppFocusChange Then
e.Cancel = True
End If
End Sub
Regards,
Gokul T