473,396 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

another simple questsion....

(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...
Nov 20 '05 #1
4 2327
Yes,
You can call the context menu with a left click. simply
cmenu.show() from the handler for that menu option.

HTH

"Sender" <us**@domain.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
(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...

Nov 20 '05 #2
"Sender" <us**@domain.com> schrieb
(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.
--
Armin

Nov 20 '05 #3
Hello,

"Sender" <us**@domain.com> schrieb:
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.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #4
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

"Sender" <us**@domain.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
(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...

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Manlio Perillo | last post by:
Regards. In the standard library there are two modules for command line parsing: optparse and getopt. In the Python Cookbook there is another simple method for parsing, using a docstring. ...
51
by: nospam | last post by:
THIS IS the DOTNETJUNKIES MESSAGE ------------------------- We're Sorry As many of you know we have recently launched SqlJunkies.com. We have overhauled our runtime and will be using it on...
6
by: anon | last post by:
Post Forwarding question...... For this control below, <asp:Button runat="server" PostTargetUrl="page2.aspx" /> The Attribute: PostTargetUrl="page2.aspx" Is this PostTargetUrl Attribute...
39
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. ...
8
by: Paul Cochrane | last post by:
Hi all, I've got an application that I'm writing that autogenerates python code which I then execute with exec(). I know that this is not the best way to run things, and I'm not 100% sure as to...
2
by: | last post by:
This should be simple, for someone... I have an access database and I want to copy records from one table in one db to another table in another Access db. I tried creating a dataset for both and...
3
by: Brad | last post by:
I have another hopefully simple question. I am so used to writing VB .Net windows apps that there are some things in ASP .Net that just does not easily cross over. I know how to pass variables to...
8
by: Eric_Dexter | last post by:
I was looking for a simple way to load a simple python program from another python program. I tried os.system(cabel) The file name is cabel.py a csound instrument editor.. The error I am...
4
by: SM | last post by:
Hello, I have a simple question, but can't find the answer. I have a string that contains a path to a file I want to add another string to the end of that string So, if i have : path =...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.