Highlighted
Absent Member.
Absent Member.
314 views

[archive] Right-click select in list box

[Migrated content. Thread originally posted on 17 September 2008]

Is there a way to get a right mouse click to select an item in a list box?

When a user right-clicks over my list box I wish to change the pop-up menu for the item that they have "selected" with the right mouse button.

Thanks!
0 Likes
4 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Right-click select in list box

You can trap the MSG-GRID-RBUTTON-UP or MSG-GRID-RBUTTON-DOWN in your event procedure.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Right-click select in list box

I just tried to do this, but the list box does not seem to provide the MSG-GRID-RBUTTON-DOWN or MSG-GRID-RBUTTON-UP events.

On a right-click, the event that it is providing is MSG-INIT-MENU. I could possibly use that, but the only problem I have is setting the list box's value/index/whatever when this event is triggered.

Is there another way? Am I following this incorrectly? Would it be possible to use some sort of Windows API call using the handle of the control to do this?

Thanks for your help!
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Right-click select in list box

I am sorry, I misread your mail, I thought you said Grid. Apologies for that. I am afraid there is no message generated for right mouse clicks to the list box.

The best you can do is probably the CMD-DBLCLICK.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Right-click select in list box

List box is not able to do what you want. It is very limited and I have often had to switch to a grid in order to get the functionality required.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.