.NET Is it possible to have a context menu for a list item with a list?

In my application, I have a drop-down list with several elements. I would like to show a context menu when the user right-clicks on a dropdown item. Is it possible? And if possible, how?

+3
source share
6 answers

Since MenuItem does not have a ContextMenu property, it is not as simple as with many other controls. You will probably need to capture the right-click event of the mouse, and then place and display the context menu manually.

Two caveats:

  • , , , ( 100% , .)

  • , , - , , , . , . , ?

0

, . ComboBox - ListBox, " ". , CB_GETCOMBOBOXINFO DropDown. , , .

, , , , , , . . .

, ListBox, , , TextBox.

+2

. .

, Spy ++.

, , .

+1

Wim , , , , .

DropdownStyle=Simple; Combo , :

http://img34.imageshack.us/img34/1695/49557147.jpg

Combo, , . , , , . , , Windows .

, Combo? , , "", .

+1

, , . , , , .

0

, "?" , combobox ; -. , , . , , :

Private Sub FavoritesBar_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles FavoritesBar.SelectedIndexChanged
    FavIndex = FavoritesBar.SelectedIndex 'FavIndex is declared as a public string.
    Dim Loc As Point = New Point(MousePosition)
    FavMenu.Location = Loc
    FavMenu.ShowDialog()
End Sub

"me.close" , me.mouseleave.

0

Source: https://habr.com/ru/post/1728045/


All Articles