another simple questsion....

  • Thread starter Thread starter Sender
  • Start date Start date
S

Sender

(Ignore this message, if duplicate..)

I have created a MainMenu with several levels. I want to run this menu when
someone (LEFT) click on a command button? How can I do this?

In VB.Net there is something called ContextMenu. But I think we can access
this contextmenu from some control by RIGHT-CLICKING not by LEFT-CLICKING.
Is there any way we acess this using LEFT button just like we do in VB6.0
using POPUMENU command and then checking which button has been pressed e.g.
Button = 1 ro Button = 2

Thanks again...
 
Sender said:
(Ignore this message, if duplicate..)

I have created a MainMenu with several levels. I want to run this
menu when
someone (LEFT) click on a command button? How can I do this?

In VB.Net there is something called ContextMenu. But I think we can
access this contextmenu from some control by RIGHT-CLICKING not by
LEFT-CLICKING. Is there any way we acess this using LEFT button just
like we do in VB6.0 using POPUMENU command and then checking which
button has been pressed e.g. Button = 1 ro Button = 2

Handle the MouseUp event - when using a context menu the standard is to show
it on MouseUp of the right mouse button - and call the menu's Show method.
In the first paragraph you wrote you created a MainMenu, in the second
you're talking about a ContextMenu. Which one did you create? The show
method is only a member of the ContextMenu.
 
Yes,
You can call the context menu with a left click. simply
cmenu.show() from the handler for that menu option.

HTH
 
Hello,

Sender said:
I have created a MainMenu with several levels. I want
to run this menu when someone (LEFT) click on a
command button?

Just call the context menu's 'Show' method.
 
Sender,
As the others have stated. In the command button's Click event, use the
ContextMenu.Show method.

For the position parameter to Show you can use Control.MousePosition
property or you can calculate a more appropriate point, such as one of the
corners of the button. Remember that Button inherits from Control.

Hope this hleps
Jay
 
Back
Top