context menu on Item in Listbox

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 1 year and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
marcius70
Posts: 2
Last visit: Sun Jan 07, 2024 11:28 pm

context menu on Item in Listbox

Post by marcius70 »

Hello,
I have a user list into a list box, now I want to select a user with the right mouse button and open a context menu. How can this be implemented?

Thx for your help :) and a happy new Year 2023

Marko
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: context menu on Item in Listbox

Post by Alexander Riedel »

[Topic moved by moderator]
Alexander Riedel
SAPIEN Technologies, Inc.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: context menu on Item in Listbox

Post by jvierra »

This is where to start. It will show you how the menu and the listbox can be set up so that menu events can act on the list item currently selected can be coded.

https://info.sapien.com/index.php?optio ... temid=2395

Do the sample code and the rest should become fairly obvious. Post back with specific questions.
This topic is 1 year and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked