Groups | Blog | Home
all groups > vb.net controls > august 2004 >

vb.net controls : Context Menu / Pop-Up menu


Ray
8/11/2004 11:12:05 PM
Hello,
I want to right click on my form or control and have a context menu appear
right next to the mouse instead of some silly relation to the 0,0 of the
screen.

Can somebody please tell me the normal way to do this.

Ray.

Mick Doherty
8/12/2004 10:33:33 AM
Set the forms/controls contextmenu property.

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html


[quoted text, click to view]


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.719 / Virus Database: 475 - Release Date: 12/07/2004

Ray
8/12/2004 11:09:52 AM
Hi Mick,
I found that option and it does position the menu exactly where I want it
but it takes a lot of control away from me.
For example I want to test the contents of a cell in a grid before deciding
what menu items are enabled. This should be done in the mouseup event but
the menu is shown before the mouse up event is fired.
A second problem is that if I right click on the grid the menu appears
before the new cell is selected!
So ideally I should be easily able to say when the menu appears in code me
thinks!

Ray.


"Mick Doherty"
<EXCHANGE#WITH@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> wrote in
message news:O$h9i%23EgEHA.3944@tk2msftngp13.phx.gbl...
[quoted text, click to view]

Mick Doherty
8/12/2004 1:48:38 PM
When we're only given half the information we may give the wrong solution
;-)
Herfried's answer is the one you're looking for.

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html


[quoted text, click to view]


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.719 / Virus Database: 475 - Release Date: 12/07/2004

hirf-spam-me-here NO[at]SPAM gmx.at
8/12/2004 1:51:10 PM
* "Ray" <not@needed.com> scripsit:
[quoted text, click to view]

For example, in the control's 'MouseUp' event:

\\\
Me.ContextMenu1.Show(Me.TreeView1, New Point(e.X, e.Y))
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
Ray
8/12/2004 1:54:25 PM
Ouch!!

[quoted text, click to view]

Ray
8/12/2004 3:50:30 PM
Mick if you can't read minds then you just don't belong here!

;)

AddThis Social Bookmark Button