Hi,
I have a menu strip with a dropdown in which the user can select (check/uncheck) from a list of 6 options. Slightly annoying feature is that after the user checks one item, the dropdown closes so they then have to click the menu to open the dropdown before they can make their next selection. I have got round this by setting menustrip1.dropdown.autoclose = false when the dropdown opens, so the user can check/uncheck from the list as required.
The next problem is that the menu dropdown now doesn't close at all once it has been opened.

I have been looking at the OptionToolStripMenuItem_MouseLeave event to either set menustrip1.dropdown.autoclose = true or to trigger menustrip1.dropdown.close() but neither close the dropdown.

Should I be triggering these commands from a different event, or am I using the wrong triggers?
Many thanks
Toomutch

You can do it by clicking another controls except the dropdownmenu. Like this

Public Class Form1

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        ToolStripMenuItem1.DropDown.AutoClose = False
    End Sub

    Private Sub Form1_MouseDown(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
        ToolStripMenuItem1.DropDown.Close()

    End Sub

    Private Sub MenuStrip1_ItemClicked(sender As Object, e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles MenuStrip1.ItemClicked
        Dim mnItem As MenuStrip = CType(sender, MenuStrip)

        For i As Integer = 0 To mnItem.Items.Count - 1
            If mnItem.Items(i).Selected = True Then
                If mnItem.Items(i).Name = "ToolStripMenuItem1" Then
                    Exit Sub
                End If
            End If
        Next


        ToolStripMenuItem1.DropDown.Close()
    End Sub
End Class

Hope it can help you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.