473,721 Members | 1,811 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need to create the equivalent of a MainMenu Popup event

ContextMenu has a Popup event but MainMenu does not.

I need Popup with MainMenu.

Do you know anyway to simulate it?
Thanks in advance

Feb 16 '08 #1
9 1840

"Academia" <ac************ @a-znet.comkirjoit ti viestissä
news:eN******** ******@TK2MSFTN GP05.phx.gbl...
ContextMenu has a Popup event but MainMenu does not.

I need Popup with MainMenu.

Do you know anyway to simulate it?
I have to ask you again why you want to use these old menus?

If you can use MenuStrip, there is MenuActivate event and then
DropDownOpening event for MenuItems.

-Teemu

Feb 16 '08 #2


I have a UserControl that has a ContextMenu, ContextMenu1, and a
GetContextMenu public function that returns ContextMenu1.

The form containing the UserControl uses GetContextMenu to get ContextMenu1
and merges it with it's MainMenu.
So your challenge is to do the same thing using the Strip elements!
Actually there is about 30 usercontrols and 50 forms so I'm not interested
in a completely new approach only in how to convert this approach to the
newer menus. Can you do it?

I doubt it because about a year ago I tried and also searched the internet
and only found others asking similar questions not getting answered.
Thanks for the interest

"Teemu" <ts*****@hotmai l.comwrote in message
news:Yw******** ***********@rea der1.news.sauna lahti.fi...
>
"Academia" <ac************ @a-znet.comkirjoit ti viestissä
news:eN******** ******@TK2MSFTN GP05.phx.gbl...
>ContextMenu has a Popup event but MainMenu does not.

I need Popup with MainMenu.

Do you know anyway to simulate it?

I have to ask you again why you want to use these old menus?

If you can use MenuStrip, there is MenuActivate event and then
DropDownOpening event for MenuItems.

-Teemu

Feb 17 '08 #3

"Academia" <ac************ @a-znet.comkirjoit ti viestissä
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
>

I have a UserControl that has a ContextMenu, ContextMenu1, and a
GetContextMenu public function that returns ContextMenu1.

The form containing the UserControl uses GetContextMenu to get
ContextMenu1 and merges it with it's MainMenu.
So your challenge is to do the same thing using the Strip elements!
OK, I can see your problem. One way to merge ContextMenuStri p to MenuStrip
is:

ToolStripMenuIt em1.DropDown=Co ntextMenuStrip1

-Teemu

Feb 17 '08 #4
Let me give a little more details and if your solution still applies I'll be
very grateful.

The context menu contains main menu items: File, Edit, and View.
Each of these have menu items on them.

The main menu has main menu items: File and View.
These also have menu items on them.

Can I put one DropDown item someplace so I can merge the context menu with
the main menu so that the File and View items merge? That would be
equivalent to what I do now.
I would like to use the strips and if it has to be, I could make a context
menu for each of the main menu items: File, Edit, and View and have a
DropDown for each. Is that what I have to do?
Thanks for staying with me. I'd love to be able to use the newer menus!


"Teemu" <ts*****@hotmai l.comwrote in message
news:Eq******** ************@re ader1.news.saun alahti.fi...
>
"Academia" <ac************ @a-znet.comkirjoit ti viestissä
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
>>

I have a UserControl that has a ContextMenu, ContextMenu1, and a
GetContextMe nu public function that returns ContextMenu1.

The form containing the UserControl uses GetContextMenu to get
ContextMenu1 and merges it with it's MainMenu.
So your challenge is to do the same thing using the Strip elements!

OK, I can see your problem. One way to merge ContextMenuStri p to MenuStrip
is:

ToolStripMenuIt em1.DropDown=Co ntextMenuStrip1

-Teemu

Feb 17 '08 #5

"Academia" <ac************ @a-znet.comkirjoit ti viestissä
news:uH******** ******@TK2MSFTN GP03.phx.gbl...
Let me give a little more details and if your solution still applies I'll
be very grateful.

The context menu contains main menu items: File, Edit, and View.
Each of these have menu items on them.

The main menu has main menu items: File and View.
These also have menu items on them.

Can I put one DropDown item someplace so I can merge the context menu with
the main menu so that the File and View items merge? That would be
equivalent to what I do now.
If you need to merge menus like you described the operation is not so
simple. You can make menu item "Merge here" in the main menu and then easily
to merge all items to that item but merging to severeal points must be done
manually.

Is the context menu used as context menu or could it be converted to menu
strips? If that is possible then the merging process will be quite easy. You
could also create invisible menu strip in your user control and use that as
context menu also.

-Teemu

Feb 17 '08 #6

"Teemu" <ts*****@hotmai l.comwrote in message
news:xw******** *************@r eader1.news.sau nalahti.fi...
>
"Academia" <ac************ @a-znet.comkirjoit ti viestissä
news:uH******** ******@TK2MSFTN GP03.phx.gbl...
>Let me give a little more details and if your solution still applies I'll
be very grateful.

The context menu contains main menu items: File, Edit, and View.
Each of these have menu items on them.

The main menu has main menu items: File and View.
These also have menu items on them.

Can I put one DropDown item someplace so I can merge the context menu
with the main menu so that the File and View items merge? That would be
equivalent to what I do now.

If you need to merge menus like you described the operation is not so
simple. You can make menu item "Merge here" in the main menu and then
easily to merge all items to that item but merging to severeal points must
be done manually.

Is the context menu used as context menu or could it be converted to menu
strips? If that is possible then the merging process will be quite easy.
You could also create invisible menu strip in your user control and use
that as context menu also.

-Teemu
The context menu is used as the usercontrol's context menu.
And the same items appear on the form's main menu.

Seems you gave me a couple of options.
I believe you understand the problem and have much more insight than I have.

I don't need the way with the less effort.
I'd like the result to be the most straightforward code.

Can you recommend a method.

As I read what you wrote it seems like I can create an invisible menu strip
in the user control and use that for both the user control's context menu
and for the form's main menu. Is that correct?

Is that the method with the most straightforward code.

Thanks a lot





Feb 17 '08 #7

"Academia" <ac************ @a-znet.comkirjoit ti viestissä
news:OL******** ******@TK2MSFTN GP04.phx.gbl...
As I read what you wrote it seems like I can create an invisible menu
strip in the user control and use that for both the user control's context
menu and for the form's main menu. Is that correct?

Is that the method with the most straightforward code.
I think this could be the easiest solution. I tried this myself but I
encountered some strange problems. I noticed that some items were moved to
another menu not copied. Merging operation worked as I thought.

I'll look if I can make a nice solution.

-Teemu

Feb 17 '08 #8

"Teemu" <ts*****@hotmai l.comkirjoitti viestissä
news:kg******** ************@re ader1.news.saun alahti.fi...
I'll look if I can make a nice solution.
Unfortunately I have to admit that I can't get it work. If I could easily
make a clone from MenuStrip then my idea would work as I thought.

Now when I create a context menu from this menu strip, the items will be
removed from menu strip and so they cannot be merged to another menu strip.

What was the original purpose for this popup event? Maybe we can find
another way to implement it.
-Teemu

Feb 19 '08 #9
I really appreciate you trying.

I note also that no one else has indicated they know how.

I down loaded an example only to find he had duplicate memu items. That is,
he created both the menustrip and also put duplicates on the contextstrip.

Thanks again.
"Teemu" <ts*****@hotmai l.comwrote in message
news:fD******** ************@re ader1.news.saun alahti.fi...
>
"Teemu" <ts*****@hotmai l.comkirjoitti viestissä
news:kg******** ************@re ader1.news.saun alahti.fi...
>I'll look if I can make a nice solution.

Unfortunately I have to admit that I can't get it work. If I could easily
make a clone from MenuStrip then my idea would work as I thought.

Now when I create a context menu from this menu strip, the items will be
removed from menu strip and so they cannot be merged to another menu
strip.

What was the original purpose for this popup event? Maybe we can find
another way to implement it.
-Teemu

Feb 19 '08 #10

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

Similar topics

2
2936
by: Mike Button | last post by:
Hello all, I am really really desperate on what I should do, and I am asking for help from anyone in this newsgroup, here's the situation: I am creating a form that is being run on a server where there is no scripts allowed running (the software is from Opentext called Livelink)- therefore I need javascript to do the tasks listed below: 1. validate the form - this has been completed 2. pop up another window that will go ahead and...
19
4106
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate the code that implements managing unbound controls on forms given the superior performance of unbound controls in a client/server environment. I can easily understand a newbie using bound controls or someone with a tight deadline. I guess I need...
7
2358
by: Jack Addington | last post by:
I've got a fairly simple application implementation that over time is going to get a lot bigger. I'm really trying to implement it in a way that will facilitate the growth. I am first writing a WinForms interface and then need to port that to a web app. I am kinda stuck on a design issue and need some suggestions / direction. Basically I have a business layer that I want to use to process any dataentry logic (row focus changes, data...
2
2103
by: Novice | last post by:
Hi all, as you can see from the subject, I'm try to use an asp:button to create a new browser window and output contents to new window But default if I do the Response.Write("..." The output gets sent directly to the window or frame that the button was contained in - if I was using regular anchor links I could just specify the target - i.e. <a href="http://...." target="nameNotInCurrentFrameset">something</a Thanks Novice
2
2166
by: polocar | last post by:
Hi, I'm writing a program using Visual C# 2005 Professional Edition, and I was trying to assign multiple MainMenu objects (one by one, of course) to the same Form (let's suppose 2 MainMenu objects). It is possible (and it's my case) that these 2 MainMenu objects use some different MenuItem objects and some identical MenuItem objects. For example, let's assume that: mainMenu1 contains miFile, miEdit, miHelp mainMenu2 contains miFile,...
0
1437
by: Kristian Frost | last post by:
Hi, I'm just getting started with VB.Net, and I'm having trouble getting the routing around of some of the data straight in my mind, which has led me to the following problem. Basically, I'm trying to create an object that will monitor the status of some switches. I created a User Control to put into a form, on which I want to have five graphical representations of LEDs, which I've got working, light up and turn off when the...
1
1461
by: mailme.grover | last post by:
Below is my code, which is kind of virtual and with its help ill use it in my main project. Now what i am looking for is can anybody write all the code inside a class...so that I can reuse it. I am kind of novice...n kind of stuc with that. from Tkinter import * root = Tk()
2
2654
by: AboutJAV | last post by:
I created a mainmenu in the form class. I added the following code public delegate void ChangeMainMenuDelegate(bool bState); public void ChangeMainMenuState(bool bState) { for (int n = 0; n < mainmenu.menuitems.count; n++) { mainmenu.menuitems.Enabled = bState; }
1
1326
by: Benson | last post by:
I have a MainMenu (MenuStrip) which will be loaded (dynamic by codes) after the program Login form. The first time run is ok. But when I close the MainMenu and go back to Login form, and then go to MainMenu again, the menu items didn't clear by MainMenu.Items.Clear(). That is: 1. Login -MainMenu.items.clear() -MainMenu (dynamic add menu items by code) =OK 2. Login -MainMenu.items.clear() -MainMenu (dynamic add menu items by code) -Login...
0
8834
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8727
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9212
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9056
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8002
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5973
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3186
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2569
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2127
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.