By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,837 Members | 1,357 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,837 IT Pros & Developers. It's quick & easy.

How do I invoke a "Right-Click" Programmtically?

P: n/a


How do I invoke a "Right-Click" Programmtically?

John

Aug 25 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
You call the method that the Click event handler would call if the right
mouse button was clicked.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

It takes a tough man to make a tender chicken salad.
<th***********@yahoo.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
>

How do I invoke a "Right-Click" Programmtically?

John

Aug 25 '06 #2

P: n/a
You don't. A right-click is a mousebutton event, and the MouseEventArgs
class has properties that will enable you to tell if its was a right-button
click. Your event handling code can then react to this programmatically.

What's the goal here?

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"th***********@yahoo.com" wrote:
>

How do I invoke a "Right-Click" Programmtically?

John

Aug 25 '06 #3

P: n/a
It depends what you mean by this.
Do you want to simulate mouse clicks and movements or you just want to fire
the events of some particular control?
--
Stoitcho Goutsev (100)

<th***********@yahoo.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
>

How do I invoke a "Right-Click" Programmtically?

John

Aug 25 '06 #4

P: n/a
I don't want to trigger any event, I just access to a right-click. It's
a long story why I want this, but is it possible with or without win32
API?
Stoitcho Goutsev (100) wrote:
It depends what you mean by this.
Do you want to simulate mouse clicks and movements or you just want to fire
the events of some particular control?
--
Stoitcho Goutsev (100)

<th***********@yahoo.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...


How do I invoke a "Right-Click" Programmtically?

John
Aug 25 '06 #5

P: n/a
Hello,

I think I haven't understood you right. But

a) If you want to invoke a system event that is a mouse right-click you
need to use the Win32 API via DLL p/Invoke.

b) If you just need to catch the event hook on the MouseClick or
MouseDown or MouseUp event and react to the member Button given by the
event:

public void OnMouseClick(object sender,
System.Windows.Forms.MouseEventArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Right)
{
// place your code here
}
}

Bye

Matthias
th***********@yahoo.com schrieb:
I don't want to trigger any event, I just access to a right-click. It's
a long story why I want this, but is it possible with or without win32
API?
Stoitcho Goutsev (100) wrote:
>It depends what you mean by this.
Do you want to simulate mouse clicks and movements or you just want to fire
the events of some particular control?
--
Stoitcho Goutsev (100)

<th***********@yahoo.comwrote in message
news:11**********************@h48g2000cwc.googleg roups.com...
>>>
How do I invoke a "Right-Click" Programmtically?

John
Aug 25 '06 #6

P: n/a
John,

Forgive me for saying this, but it is really hard to understand your
question. That's why I asked for more info.

"...access to a right-click.." doesn't makes sense to me.

Please try to explain with more words your problem.
--
Stoitcho Goutsev (100)
<th***********@yahoo.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
>I don't want to trigger any event, I just access to a right-click. It's
a long story why I want this, but is it possible with or without win32
API?
Stoitcho Goutsev (100) wrote:
>It depends what you mean by this.
Do you want to simulate mouse clicks and movements or you just want to
fire
the events of some particular control?
--
Stoitcho Goutsev (100)

<th***********@yahoo.comwrote in message
news:11**********************@h48g2000cwc.googleg roups.com...
>

How do I invoke a "Right-Click" Programmtically?

John

Aug 28 '06 #7

P: n/a
Hi Stoitcho,
I apologize for not responding more promptly. I actually solved what I
was trying to do, sorry for any ambiguity .

John
Stoitcho Goutsev (100) wrote:
John,

Forgive me for saying this, but it is really hard to understand your
question. That's why I asked for more info.

"...access to a right-click.." doesn't makes sense to me.

Please try to explain with more words your problem.
--
Stoitcho Goutsev (100)
<th***********@yahoo.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
I don't want to trigger any event, I just access to a right-click. It's
a long story why I want this, but is it possible with or without win32
API?
Stoitcho Goutsev (100) wrote:
It depends what you mean by this.
Do you want to simulate mouse clicks and movements or you just want to
fire
the events of some particular control?
--
Stoitcho Goutsev (100)

<th***********@yahoo.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
How do I invoke a "Right-Click" Programmtically?

John
Sep 24 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.