473,382 Members | 1,255 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,382 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 7799
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. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...

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.