473,624 Members | 2,261 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Clear MainMenu items

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 ->
MainMenu.items. clear() -MainMenu (dynamic add menu items by code) =>
menu items are double loaded???

Any hints?
Benson
VB2005
Feb 5 '07 #1
1 1321
You might try placing a stop in the code where you add the menu items
just to check whether this code is being executed twice the second
time around for some reason.

=============== =====
Clay Burch
Syncfusion, Inc.
Feb 5 '07 #2

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

Similar topics

5
2014
by: Davie | last post by:
I'm developing an application on the smartphone. To reduce the size of the application i'm using panels where appropriate instead of forms. As a result of the design, I need to have different context menus on one form. I had tried to declare two MainMenu items and then simply switch the display accordingly. eg. public void displayPanel1(){ this.Menu = this.mainMenu1; // this.Refresh(); } public void displayPanel2(){ this.Menu =...
2
2677
by: VSNT | last post by:
Is there a way to paint the backcolor of a main menu. I can paint the menu ites from the size and paint events but there doesnot appear to be an accessable paint method for the actual MainMenu control. The Idea is to not have a standard windows MainMenu (AKA: Gray in in most cases) but something that matches and flows with the rest of the GUI. Any ideas much apreciated. Thanks, Allen
7
1685
by: Grumpy Aero Guy | last post by:
I have a windows form project. I have added a mainmenu control which has several items with assoicated subroutines. I can not get the menu to display when I debug the application for anything. YES, I am "activating" the mainmenu control prior to "building" the solution... i.e. the main menu control is "active" and the menu appears in the form's design view.
21
5192
by: StriderBob | last post by:
Situation : FormX is mdi child form containing 2 ListViews ListView1 contains a list of table names and 4 sub items with data about each table. ListView2 contains a list of the columns on each table and 11 sub items with data about each column. When a Row in ListView1 is selected the Data in ListVies2 is loaded to show the correct data. Initially the first row in ListView1 is selected in FormX load
0
1174
by: dpierson | last post by:
I have just converted one of my applications from .Net 1.1 / VS2003 to ..Net 2.0 / VS2005. I'm now seeing some different behavior in my app. Here's a simple case description: Form 1: Stock form with MainMenu and one MenuItem (menuItem1) which has several sub-MenuItems of its own. IsMdiContainer = true. Has a button (button1).
0
2958
by: genojoe | last post by:
Included below are four methods and a Friend that can be inserted directly into a form that already contains Button1, Button2, and MenuStrip1. Button1 populates the MainMenu control, button2 populates the MenuStrip control. The MainMenu is from legacy 2003 and works fine. I want to upgrade to the MenuStrip but cannot find a way to duplicate legacy code. Shown below is my best effort. I am having two problems. #1: ToolStripMenuItem...
2
2549
by: Academia | last post by:
In an old project I still use MainMenu and ContexMenu. How can I get them to appear in my Toolbox? Thanks
9
1833
by: Academia | last post by:
ContextMenu has a Popup event but MainMenu does not. I need Popup with MainMenu. Do you know anyway to simulate it? Thanks in advance
0
992
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
Whenever I launch an MDI Child, I can add items to the MDI Parent's MainMenu easy enough, but how do I call them from the MDI Child? In the Parent, private void miPrint_Click(object sender, EventArgs e) { /* code */ } What changes? The Menu Item miPrint is still located in the Parent. Do I need to check the sender object?
0
8170
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
8675
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8474
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
7158
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...
1
6108
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4078
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2604
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
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
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.