473,503 Members | 2,075 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 1825

"Academia" <ac************@a-znet.comkirjoitti viestissä
news:eN**************@TK2MSFTNGP05.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*****@hotmail.comwrote in message
news:Yw*******************@reader1.news.saunalahti .fi...
>
"Academia" <ac************@a-znet.comkirjoitti viestissä
news:eN**************@TK2MSFTNGP05.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.comkirjoitti viestissä
news:%2****************@TK2MSFTNGP04.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 ContextMenuStrip to MenuStrip
is:

ToolStripMenuItem1.DropDown=ContextMenuStrip1

-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*****@hotmail.comwrote in message
news:Eq********************@reader1.news.saunalaht i.fi...
>
"Academia" <ac************@a-znet.comkirjoitti viestissä
news:%2****************@TK2MSFTNGP04.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 ContextMenuStrip to MenuStrip
is:

ToolStripMenuItem1.DropDown=ContextMenuStrip1

-Teemu

Feb 17 '08 #5

"Academia" <ac************@a-znet.comkirjoitti viestissä
news:uH**************@TK2MSFTNGP03.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*****@hotmail.comwrote in message
news:xw*********************@reader1.news.saunalah ti.fi...
>
"Academia" <ac************@a-znet.comkirjoitti viestissä
news:uH**************@TK2MSFTNGP03.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.comkirjoitti viestissä
news:OL**************@TK2MSFTNGP04.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*****@hotmail.comkirjoitti viestissä
news:kg********************@reader1.news.saunalaht i.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*****@hotmail.comwrote in message
news:fD********************@reader1.news.saunalaht i.fi...
>
"Teemu" <ts*****@hotmail.comkirjoitti viestissä
news:kg********************@reader1.news.saunalaht i.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
2907
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...
19
4065
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...
7
2346
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...
2
2082
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...
2
2149
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...
0
1413
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...
1
1457
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...
2
2648
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 <...
1
1315
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...
0
7193
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
7067
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
7316
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...
1
6975
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7449
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...
1
4992
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4666
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...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1495
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 ...

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.