delayed closing toolstripdropdown


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?

Naamloos.jpg


8 Replies 1 reply marked as answer

BA BagavathiPerumal Apranandham Syncfusion Team July 12, 2022 04:42 PM UTC

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



GT Gokul Thanudhas Syncfusion Team July 15, 2022 07:29 AM UTC

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.


Attachment: RibbonControl_3a5e77b5.zip


UN Unknown July 17, 2022 10:48 AM UTC

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



GT Gokul Thanudhas Syncfusion Team July 18, 2022 04:06 PM UTC

Hi Kim,


We are unable to reproduce the issue from our end. Could you please share the issue reproducible sample


Regards,

Gokul T



UN Unknown July 18, 2022 06:44 PM UTC

here an example


Attachment: WindowsApp1_40a54bf.zip


GT Gokul Thanudhas Syncfusion Team July 19, 2022 05:24 PM UTC

Hi Kim,


We have modified the given sample based on your requirement. Please refer the sample for your reference.


Regards,

Gokul T


Attachment: WindowsApp1_f1aaacec.zip


UN Unknown July 19, 2022 06:07 PM UTC

ok, thanks.

what is changed, i don't see any code, how do i apply it to my app ?



GT Gokul Thanudhas Syncfusion Team July 20, 2022 12:38 PM UTC

Hi Kim,


Please find the code changes that we have made in the modified sample.


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


Marked as answer
Loader.
Up arrow icon