Skip to main content

[archive] Right-click select in list box

  • September 18, 2008
  • 6 replies
  • 0 views

[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!

6 replies

[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!
You can trap the MSG-GRID-RBUTTON-UP or MSG-GRID-RBUTTON-DOWN in your event procedure.

[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!
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!

[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!
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!

[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!
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!

[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!
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.

[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!
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.