#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default listbox

is there a way to add a rightclick mouse event to a
listbox control? or a rightclick event to the whole
userform? using windows api's maybe?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default listbox

ok, figured out how to add shortcut menu to mousedown
event... my next question is when mousedown event detects
button 2 and executes code, how can i select the item the
pointer is currently pointing at. for instance,
rightclick a cell on a worksheet and the cell is selected
and the shorcut menu is displayed.




-----Original Message-----

"jim c." wrote in message
...
is there a way to add a rightclick mouse event to a
listbox control? or a rightclick event to the whole
userform? using windows api's maybe?


Use the mousedown event

Private Sub ListBox1_MouseDown(ByVal Button As Integer,

ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
If Button = 2 Then 'Right Mouse button is 2
' Do your stuff
End If

End Sub

Keith


.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Listbox 2 takes the value of Listbox 1 Illya Teideman Excel Discussion (Misc queries) 3 April 10th 07 03:20 PM
listbox B conditional of input in Listbox A Kim K Excel Discussion (Misc queries) 1 October 31st 06 08:27 PM
Listbox B if LIstbox A equals Kim K Excel Discussion (Misc queries) 2 October 31st 06 07:03 PM
Listbox asukuo Excel Programming 1 August 14th 03 05:32 AM
Sorting ListBox results or transposing ListBox values to other cells for sorting Rob[_8_] Excel Programming 1 July 9th 03 04:35 AM


All times are GMT +1. The time now is 11:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"