Skip to main content

[archive] Mouse Pointer position over List box

  • September 11, 2009
  • 4 replies
  • 0 views

[Migrated content. Thread originally posted on 10 September 2009]

What I'm trying to do is to allow the user to right click the mouse to bring up a pop up menu when over a list box. However, doing a right click on the mouse does not select the record that you are currently pointing to, so the user would have to left click to select the record they want to process, then right click to bring up the list box pop up menu.

I have tried using the W$MOUSE call to get the mouse row value using the init-menu event and no matter which op code I use, it returns a value that matches the line location of the list box control that I use an inquire to get.

What I want to do is for when right clicking on the mouse with the pointer pointing at a record that hasn't been selected, some how select that record for the pop up menu processing.

Any ideas????

4 replies

[Migrated content. Thread originally posted on 10 September 2009]

What I'm trying to do is to allow the user to right click the mouse to bring up a pop up menu when over a list box. However, doing a right click on the mouse does not select the record that you are currently pointing to, so the user would have to left click to select the record they want to process, then right click to bring up the list box pop up menu.

I have tried using the W$MOUSE call to get the mouse row value using the init-menu event and no matter which op code I use, it returns a value that matches the line location of the list box control that I use an inquire to get.

What I want to do is for when right clicking on the mouse with the pointer pointing at a record that hasn't been selected, some how select that record for the pop up menu processing.

Any ideas????
I have some grids that behave exactly the way you want. In fact I had to code it to stop this behavior for one grid because it was causing trouble :-) So I'm thinking that if you can switch your listbox to a grid it will probably work for you. I don't know why listboxes don't behave the same as a grid with respect to the left/right mouse buttons for selection... Seems to me they should.

[Migrated content. Thread originally posted on 10 September 2009]

What I'm trying to do is to allow the user to right click the mouse to bring up a pop up menu when over a list box. However, doing a right click on the mouse does not select the record that you are currently pointing to, so the user would have to left click to select the record they want to process, then right click to bring up the list box pop up menu.

I have tried using the W$MOUSE call to get the mouse row value using the init-menu event and no matter which op code I use, it returns a value that matches the line location of the list box control that I use an inquire to get.

What I want to do is for when right clicking on the mouse with the pointer pointing at a record that hasn't been selected, some how select that record for the pop up menu processing.

Any ideas????
I have some grids that behave exactly the way you want. In fact I had to code it to stop this behavior for one grid because it was causing trouble :-) So I'm thinking that if you can switch your listbox to a grid it will probably work for you. I don't know why listboxes don't behave the same as a grid with respect to the left/right mouse buttons for selection... Seems to me they should.

[Migrated content. Thread originally posted on 10 September 2009]

What I'm trying to do is to allow the user to right click the mouse to bring up a pop up menu when over a list box. However, doing a right click on the mouse does not select the record that you are currently pointing to, so the user would have to left click to select the record they want to process, then right click to bring up the list box pop up menu.

I have tried using the W$MOUSE call to get the mouse row value using the init-menu event and no matter which op code I use, it returns a value that matches the line location of the list box control that I use an inquire to get.

What I want to do is for when right clicking on the mouse with the pointer pointing at a record that hasn't been selected, some how select that record for the pop up menu processing.

Any ideas????
I have some grids that behave exactly the way you want. In fact I had to code it to stop this behavior for one grid because it was causing trouble :-) So I'm thinking that if you can switch your listbox to a grid it will probably work for you. I don't know why listboxes don't behave the same as a grid with respect to the left/right mouse buttons for selection... Seems to me they should.

[Migrated content. Thread originally posted on 10 September 2009]

What I'm trying to do is to allow the user to right click the mouse to bring up a pop up menu when over a list box. However, doing a right click on the mouse does not select the record that you are currently pointing to, so the user would have to left click to select the record they want to process, then right click to bring up the list box pop up menu.

I have tried using the W$MOUSE call to get the mouse row value using the init-menu event and no matter which op code I use, it returns a value that matches the line location of the list box control that I use an inquire to get.

What I want to do is for when right clicking on the mouse with the pointer pointing at a record that hasn't been selected, some how select that record for the pop up menu processing.

Any ideas????
This has been raised many times before - it is very annoying but it is just not possible to do what you (and many of us) want with a list box and drop down menus.

As Mikalodeon, where it has been essential I have used GRIDS but of course they are more problematic than lists, and where lists are nice easy constructs to use - they do not process the right hand mouse click as we would wish.