473,406 Members | 2,769 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,406 software developers and data experts.

menuStrip and toolStrip acting oddly after resource deletion

HaLo2FrEeEk
404 256MB
Ok, I have a menuStrip and a toolStrip. the menuStrip is laid out like this:

Actions
Connect
Disconnect
-
Exit

Pretty simple. The toolstrip has 1 item, a toolstripstatus. I decided I wanted to add a little icon next to the status text, so I opened up the image property in Design mode and imported 2 images. Both were PNG images and were 256x256 resolution. I decided that I wanted to use smaller versions since it was, after all, a toolstripstatus. So I deleted the 2 image resources from the solution explorer and immediately got loads of errors. Turns out the toolstripstatus was still trying to access the image resource that I deleted. No problem, I'll just manually remove that line of code from the Designer. Of course not, now I get all sorts of errors when I try to debug, something like "code generation for property 'items' failed...", and when that went away and my project actually debugs...lo and behold, I have no menustrip items OR toolstripstatus! The menu strip is still there and the toolstrip is still there...but their items are gone!

This is really frustrating because I went through ALL of my project files and looked for instances of the name of the original image I used, or even any instance of the text ".png". There were none, in any of the project files. So why am I still having this problem?!? If I look in the designer I can see that my menu strip items are in there, along with my toolstrip (even though I deleted the toolstrip from the project...) Someone PLEASE help me!
Nov 26 '09 #1
3 7803
Plater
7,872 Expert 4TB
I think you will see for your Form an extra "sub" file in the solution explorer. It should be an extra resx file. It probably has something to do with that
Nov 30 '09 #2
HaLo2FrEeEk
404 256MB
I figured it out, I guess for some reason the pointers (?) to the menu items and the label in the status bar got removed from the declaration of the status bar and menustrip in the designer.cs file. Weird, but I fixed it.
Dec 2 '09 #3
SxOne
1
THX, HaLo2FrEeEk
you gave me directions and ideas ;)

huh, i had SAME SAME problem NOW (i have menustrip, toolstrip and statusstrip)

so here is how i fixed it
i have created new project, and add same controls (menustrip, toolstrip and statusstrip) and added same items (statuslabels, buttons.......) just one of each, so i can see their core in designer !!!!!!!
and just compare old and new project code and add in you project code that is missing (Search fo statusstrip1.....)....
this is Some of code you need to look for !!!

first under private void InitializeComponent()

this.statusStrip1.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.menuStrip1.SuspendLayout();

This lines is for adding your items, must use SAME NAMES !!! (need to add addRange for Menustrip & toolstrip also...)
//
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripStatusLabel1,
this.toolStripStatusLabel2,
this.toolStripProgressBar1});

//
// Form1
//
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();

need to do same for any Strip controle.....

best regards
SxOne from Serbia
Jan 18 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: VBTricks.de.vu Webmaster | last post by:
Hello, I'm still reimplementing the GUI of my app using the new toolstrips. My current problem is to autosize a combobox to the available with in the parent toolstrip. There are some buttons...
4
by: Teemu | last post by:
I'm wondering if there is a easy way to change for example toolstrips appearance. I'd like to have the same theme as in VB2005. Brown backgroung instead of the light blue. Can this be done without...
0
by: academic | last post by:
Using ToolStripManager.Merge(ToolStrip,ToolStrip) I've been able to merge a MenuStrip into a MenuStrip but never a ContextMenuStrip into a MenuStrip. From the docs it seems to me I should be...
0
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...
2
by: Mark | last post by:
Hi, I have a toolstrip with several buttons, I can only see the image assigned for each button in design time and not on runtime. I've tried several different formats .bmp, .png, .ico for these...
1
by: chandu | last post by:
Hello , I am developing an application which it contains one MenuStrip and ToolStrip. now i have to replace these controls with some other controls. is dotnet providing any alternate controls...
2
by: Doc John | last post by:
After I've added the menustrip and the toolstrip to my MDI windows Form (and I've added their respective items), I notice that the items disappear. They're still in the code, but the association...
1
by: S. Viswanathan | last post by:
Hi! When mouse over on menuitem, the corresponding menuitem text should display in StatusStrip control. How to do this? Simillarly for when mouse over on toolstrip item, the corresponding...
0
by: CAM | last post by:
Hello, Can anyone tell me if its possible to create one menustrip, toolstrip, and one statusstrip and attached to three to four forms? I just don't want to recreate the strips for every form. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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
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
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...

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.