Current location - Recipe Complete Network - Complete cookbook of home-style dishes - Vb in listbox, pop-up right-click menu.
Vb in listbox, pop-up right-click menu.
First, create a new main menu in the menu editor, just call lstrmnu to make it invisible, then add a submenu under it (click the right arrow button), write all the menu items you want to realize, and write the popupmenu lstrmnu in the right-click event of the listbox. To edit the event handling of a menu item, just click the menu item directly in design mode (it is useless to right-click the listbox in design mode) and the code window will pop up.

If you want to operate on an item in the list, just use the listindex property of the listbox (this integer starting from 0 is the serial number of the item in the listbox).