I like the context menu to be displayed only if the item is really selected in the list in the C # winforms application.
Currently, I can select an item if it clicked correctly, and I can turn off the right-click menu if nothing is selected, however I do not want the menu to even display.
How can I do that?
private void genPassMenu_Opening(object sender, CancelEventArgs e) { genPassMenu.Enabled = lstPasswords.SelectedIndex > 0; genPassMenu.Visible = lstPasswords.SelectedIndex > 0; }
I tried both of these situations myself, and it only works for resolved ones.
Perhaps discovery is not the right choice? Tx
c #
user289130
source share