Can I generate a Right-Click event for a listbox? 
Author Message
 Can I generate a Right-Click event for a listbox?

Hi

I would like to bring a popup menu when a user right-clicks an item in a
list box.  The event needs to act like the List1_Click() event and return
the listindex.

Can this be done?  Any help appreciated.

--
Regards

Remove 'z' from jbz to email.

--
Regards

Remove 'z' from jbz to email.



Tue, 12 Sep 2000 03:00:00 GMT  
 Can I generate a Right-Click event for a listbox?

Hello james,

If you want to popup a menu when user clicks the right button on a list
item:

Private Sub Listbox_MouseDown()
    if button = 2 then ''you can use this as an event also and do some other
tasks
        popupmenu menuname
    end if
End Sub

Whenever user right clicks the button value is 2 and hence you check it in
the MouseDown event to make sure that it is button 2. Since you know it is
button 2, you can perform a task.

hope this helps
All the best



Tue, 12 Sep 2000 03:00:00 GMT  
 Can I generate a Right-Click event for a listbox?

Hi,

If possible, replace listbox with a listview with in report mode
HideColumnHeaders = True then use the HitTest method in the mouseup event.
HitTest will return the ListItem that the x, y coords are over.

Hope this helps!

Shawn

Quote:

> Hi

> I would like to bring a popup menu when a user right-clicks an item in a
> list box.  The event needs to act like the List1_Click() event and return
> the listindex.

> Can this be done?  Any help appreciated.

> --
> Regards

> Remove 'z' from jbz to email.

> --
> Regards

> Remove 'z' from jbz to email.



Tue, 12 Sep 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. listbox event for right mouse click?

2. label click event only works with right mouse click

3. Right click to generate pop up menu in Tree View

4. Need help: listbox control & right-click

5. Right clicking in listboxes!

6. Right Click on ListBox

7. Select ListBox item with right click

8. Listbox and Right Mouse click

9. Right-Click on ListBox?

10. VB5 Listbox right click

11. Listbox, and right click

12. a question on using right-click on a listbox

 

 
Powered by phpBB® Forum Software