469,609 Members | 1,209 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

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



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

John

Aug 25 '06 #1
7 9861
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
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
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
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
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
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
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.

Similar topics

reply views Thread by pom | last post: by
1 post views Thread by Edward King | last post: by
6 posts views Thread by Dean Slindee | last post: by
1 post views Thread by tshad | last post: by
4 posts views Thread by lionheart | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.