Click here to Skip to main content
15,921,113 members
Home / Discussions / C#
   

C#

 
GeneralRe: SearchDirectory Pin
Jasmine25015-Jun-13 11:58
Jasmine25015-Jun-13 11:58 
GeneralRe: SearchDirectory Pin
Pete O'Hanlon5-Jun-13 12:14
mvePete O'Hanlon5-Jun-13 12:14 
GeneralRe: SearchDirectory Pin
Jasmine25013-Jun-13 12:31
Jasmine25013-Jun-13 12:31 
GeneralRe: SearchDirectory Pin
HubSnippets10-Jun-13 0:47
HubSnippets10-Jun-13 0:47 
GeneralRe: SearchDirectory Pin
Bernhard Hiller3-Jun-13 21:10
Bernhard Hiller3-Jun-13 21:10 
GeneralRe: SearchDirectory Pin
HubSnippets10-Jun-13 0:20
HubSnippets10-Jun-13 0:20 
QuestionSending messages to a listbox's context menu. Pin
Septimus Hedgehog2-Jun-13 22:28
Septimus Hedgehog2-Jun-13 22:28 
AnswerRe: Sending messages to a listbox's context menu. Pin
DaveyM693-Jun-13 0:15
professionalDaveyM693-Jun-13 0:15 
You can send WM_RBUTTONDOWN (0x204) followed by WM_RBUTTONUP (0x205) to the handle of the listbox and that will display your context menu.
C#
[DllImport("User32.dll")]
public static extern int SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam);
public const int WM_RBUTTONDOWN = 0x204; //Right mouse button down
public const int WM_RBUTTONUP = 0x205;   //Right mouse button up

C#
SendMessage(listBox1.Handle, WM_RBUTTONDOWN, IntPtr.Zero, IntPtr.Zero);
SendMessage(listBox1.Handle, WM_RBUTTONUP, IntPtr.Zero, IntPtr.Zero);

Edit: References
WM_RBUTTONDOWN[^]
WM_RBUTTONUP[^]
Dave

Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.
Astonish us. Be exceptional. (Pete O'Hanlon)

BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)




modified 3-Jun-13 6:23am.

GeneralRe: Sending messages to a listbox's context menu. Pin
Septimus Hedgehog3-Jun-13 0:46
Septimus Hedgehog3-Jun-13 0:46 
AnswerRe: Sending messages to a listbox's context menu. Pin
DaveyM693-Jun-13 0:55
professionalDaveyM693-Jun-13 0:55 
GeneralRe: Sending messages to a listbox's context menu. Pin
Septimus Hedgehog3-Jun-13 1:00
Septimus Hedgehog3-Jun-13 1:00 
GeneralRe: Sending messages to a listbox's context menu. Pin
DaveyM693-Jun-13 1:10
professionalDaveyM693-Jun-13 1:10 
GeneralRe: Sending messages to a listbox's context menu. Pin
Septimus Hedgehog3-Jun-13 1:54
Septimus Hedgehog3-Jun-13 1:54 
GeneralRe: Sending messages to a listbox's context menu. Pin
BobJanova3-Jun-13 4:06
BobJanova3-Jun-13 4:06 
GeneralRe: Sending messages to a listbox's context menu. Pin
Septimus Hedgehog3-Jun-13 5:53
Septimus Hedgehog3-Jun-13 5:53 
QuestionRun-time video editing Pin
yassine7072-Jun-13 14:55
yassine7072-Jun-13 14:55 
AnswerRe: Run-time video editing Pin
Richard MacCutchan2-Jun-13 20:51
mveRichard MacCutchan2-Jun-13 20:51 
QuestionHow to Open Cash Drawer Pin
Jassim Rahma2-Jun-13 10:26
Jassim Rahma2-Jun-13 10:26 
AnswerRe: How to Open Cash Drawer Pin
dusty_dex2-Jun-13 11:04
dusty_dex2-Jun-13 11:04 
GeneralRe: How to Open Cash Drawer Pin
Jassim Rahma2-Jun-13 11:17
Jassim Rahma2-Jun-13 11:17 
GeneralRe: How to Open Cash Drawer Pin
dusty_dex2-Jun-13 22:08
dusty_dex2-Jun-13 22:08 
AnswerRe: How to Open Cash Drawer Pin
dusty_dex3-Jun-13 2:02
dusty_dex3-Jun-13 2:02 
QuestionBinary Validation File Pin
Jassim Rahma2-Jun-13 10:25
Jassim Rahma2-Jun-13 10:25 
AnswerRe: Binary Validation File Pin
Mycroft Holmes2-Jun-13 11:53
professionalMycroft Holmes2-Jun-13 11:53 
AnswerRe: Binary Validation File Pin
BobJanova3-Jun-13 4:08
BobJanova3-Jun-13 4:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.