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

contextmenu & left mouse click

P: n/a
somebody wrote the solution for this many many days ago on this
newsgroup....but I lost the notes..... and everyone knows how hard it is to
search on newgroups (archives).... so here I am asking again.

i have a button: button1 and a contextmenu: contextmenu1.

what's the code to execute (open) contextmenu1 by clicking LEFT button of
the mouse.

thanks in advance!

Nov 20 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
* "Sender" <us**@domain.com> scripsit:
somebody wrote the solution for this many many days ago on this
newsgroup....but I lost the notes..... and everyone knows how hard it is to
search on newgroups (archives).... so here I am asking again.

i have a button: button1 and a contextmenu: contextmenu1.

what's the code to execute (open) contextmenu1 by clicking LEFT button of
the mouse.


\\\
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.ContextMenu1.Show(Me.Button1, New Point(0, 0))
End Sub
///

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

P: n/a
worked very well. thx.
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bm************@ID-208219.news.uni-berlin.de...
* "Sender" <us**@domain.com> scripsit:
somebody wrote the solution for this many many days ago on this
newsgroup....but I lost the notes..... and everyone knows how hard it is to search on newgroups (archives).... so here I am asking again.

i have a button: button1 and a contextmenu: contextmenu1.

what's the code to execute (open) contextmenu1 by clicking LEFT button of the mouse.
\\\
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As

System.EventArgs) Handles Button1.Click Me.ContextMenu1.Show(Me.Button1, New Point(0, 0))
End Sub
///

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>

Nov 20 '05 #3

P: n/a
Dim position As System.Drawing.Point
position.X = Button1.Left
position.Y = Button1.Top + Button1.Height
ContextMenu1.Show(Me, position)

This code will show the menu with its left edge aligned with the left edge
of the button, and its top edge aligned witht the bottom edge of the button.
"Sender" <us**@domain.com> wrote in message
news:Or**************@TK2MSFTNGP10.phx.gbl...
somebody wrote the solution for this many many days ago on this
newsgroup....but I lost the notes..... and everyone knows how hard it is to search on newgroups (archives).... so here I am asking again.

i have a button: button1 and a contextmenu: contextmenu1.

what's the code to execute (open) contextmenu1 by clicking LEFT button of
the mouse.

thanks in advance!


Nov 20 '05 #4

P: n/a
"Sender" <us**@domain.com> schrieb
somebody wrote the solution for this many many days ago on this
newsgroup....but I lost the notes..... and everyone knows how hard it
is to search on newgroups (archives).... so here I am asking
again.
A search on the Sender should help. ;)
i have a button: button1 and a contextmenu: contextmenu1.

what's the code to execute (open) contextmenu1 by clicking LEFT
button of the mouse.


I'd check which mouse button was pressed in the mousedown event. If it's the
left button, show the context menu (use it's show method).
--
Armin

Nov 20 '05 #5

P: n/a
Hi Sender,

|| and everyone knows how hard it is
|| to search on newgroups (archives)

Lol. Oh yes they do! Oh no they don't!!

I'll admit I have it easier than Joe Public because I have a Favourite
Link set up for me but it is very easy to search Google Groups for stuff.

Go to Google.
Click on Google Groups.
Type this into the box:
contextmenu left mouse button group:*languages.vb.

Your previous query is the very first one shown!!
Here's a better tip. Don't call yourself Sender. Use something with
imagination - SenderSplendour, for example. Now if you go into Advanced Groups
Search (the link is just above the box in Google Groups), you can enter your
name in the Author box. With your unique name you'll only get your own posts
reported.

My other tip, but you've already picked up on that, is to use a decent
title for your query. "Context menu & left mouse click" pretty much says it
all. But "Beginners question" which you had before is hard to remember once
it's heading into the middle distance. Also general titles like "Threading
question" will produce loads of returns because there are lots of questions
about threading.

So - a unique name and a unique title will help you match keywords.

And using Advanced Groups Search (sort by date, too) will help you limit
the search to just this newsgroup and/or yourself.

Here's the link that I use to get Advanced Groups Search for just this
newsgroup, sorted by date.

http://www.google.co.uk/advanced_gro..._ugroup=*langu
ages.vb.

And here's exactly the same page but using a TinyUrl (so that it won't be
split like the one above)
http://tinyurl.com/q8ks

Regards,
Fergus

Nov 20 '05 #6

P: n/a
Thanks for you suggestions. So now my id would be 'DON' - how is this?
"Fergus Cooney" <fi******@tesco.net> wrote in message
news:uL*************@TK2MSFTNGP10.phx.gbl...
Hi Sender,

|| and everyone knows how hard it is
|| to search on newgroups (archives)

Lol. Oh yes they do! Oh no they don't!!

I'll admit I have it easier than Joe Public because I have a Favourite
Link set up for me but it is very easy to search Google Groups for stuff.

Go to Google.
Click on Google Groups.
Type this into the box:
contextmenu left mouse button group:*languages.vb.

Your previous query is the very first one shown!!
Here's a better tip. Don't call yourself Sender. Use something with
imagination - SenderSplendour, for example. Now if you go into Advanced Groups Search (the link is just above the box in Google Groups), you can enter your name in the Author box. With your unique name you'll only get your own posts reported.

My other tip, but you've already picked up on that, is to use a decent
title for your query. "Context menu & left mouse click" pretty much says it all. But "Beginners question" which you had before is hard to remember once it's heading into the middle distance. Also general titles like "Threading
question" will produce loads of returns because there are lots of questions about threading.

So - a unique name and a unique title will help you match keywords.

And using Advanced Groups Search (sort by date, too) will help you limit the search to just this newsgroup and/or yourself.

Here's the link that I use to get Advanced Groups Search for just this
newsgroup, sorted by date.

http://www.google.co.uk/advanced_gro..._ugroup=*langu ages.vb.

And here's exactly the same page but using a TinyUrl (so that it won't be split like the one above)
http://tinyurl.com/q8ks

Regards,
Fergus

Nov 20 '05 #7

P: n/a
Hi Sender / Don,

Do a search using Don as the author as see how much turns up. Uniqueness
is harder with only three letters. Go wild! ;-)

Regards,
Fergus
Nov 20 '05 #8

P: n/a
* "Sender" <us**@domain.com> scripsit:
Thanks for you suggestions. So now my id would be 'DON' - how is this?


Why not use a real name?

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #9

P: n/a
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schrieb
* "Sender" <us**@domain.com> scripsit:
Thanks for you suggestions. So now my id would be 'DON' - how is
this?


Why not use a real name?


Don't you know Don Sender? (brother of don't send)
--
Armin

Nov 20 '05 #10

P: n/a
* "Armin Zingler" <az*******@freenet.de> scripsit:
* "Sender" <us**@domain.com> scripsit:
Thanks for you suggestions. So now my id would be 'DON' - how is
this?


Why not use a real name?


Don't you know Don Sender? (brother of don't send)


ROFL

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.