vb.net - Context Menu Strip Control With and Without Selected Grid -
i don't know search i'll ask this:
i have context menu strip linked listview,
what need when right click highlighted variable in grid list view, menu items displayed, , when right click empty grid, grid settings displayed.
how can achieve this?
i doubt user appreciate approach; plan display 2 different menus same action - click. may not apparent how 1 menu or other. further, not clear why "settings" or main menu ever need hidden them.
rather 2 menus, why not 1 menu 2 submenus, make easy find them?
private sub mylv_mouseup(sender... if (e.button = windows.forms.mousebuttons.right) lvcms.items("itemmenu").enabled = (mylv.selecteditems.count > 0) ' show (may need if there 2 menus) lvcms.show(mylv.pointtoscreen(new point(e.x, e.y))) end if end sub 
the lv show assigned menu on own, if have 2, may want/need display manually, shown. using mouseup event lv has reacted mousedn , changed selected item. thing varies menu-wise whether itemmenu enabled or not.
clicking on empty area deselects item. barring button same, hard deselect item because empty area can nonexistent:

only orange-ish area empty grid, add 1 more item fill in bottom , cause scroll bar , there none. partly why separate menu , special set of conditions may not idea.
Comments
Post a Comment