Tyrre Enge

Tyrre Enge

  • NA
  • 1
  • 0

Lost all items in MenuStrip and statusStrip

Jan 1 2010 4:54 PM

Hi  !
I have a Windows form made in vs 2008, Framework 3.5. To my windows form i have added a menustrip and a statusstrip. Its all worked fine. I have added som png images and uses System.Resources to handle the images. It all started when i tried to change a image for a commandbutton. I deleted the image from Resources folder and the all the items in the MenuStrip and the StatusStrip where gone.

In the designer.cs for my form the items are still there but the controls don´t find them.  Here is the designers code and you can se the items. Now I have removed all the images from the Resources folder.

How do i fix this. I don´t want to redo all the work. It´s happend before, and then I recreated all the controls, but I don´t want to do tha again. Som whats wrong and why does this happend.
Regards!

/Tyronne
 
  1. namespace HUGO  
  2. {  
  3.     partial class frmMain  
  4.     {  
  5.         /// <summary>  
  6.         /// Required designer variable.  
  7.         /// </summary>  
  8.         private System.ComponentModel.IContainer components = null;  
  9.         /// <summary>  
  10.         /// Clean up any resources being used.  
  11.         /// </summary>  
  12.         /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>  
  13.         protected override void Dispose(bool disposing)  
  14.         {  
  15.             if (disposing && (components != null))  
  16.             {  
  17.                 components.Dispose();  
  18.             }  
  19.             base.Dispose(disposing);  
  20.         }  
  21.         #region Windows Form Designer generated code  
  22.         /// <summary>  
  23.         /// Required method for Designer support - do not modify  
  24.         /// the contents of this method with the code editor.  
  25.         /// </summary>  
  26.         private void InitializeComponent()  
  27.         {  
  28.             this.components = new System.ComponentModel.Container();  
  29.             this.panel1 = new System.Windows.Forms.Panel();  
  30.             this.pictureBox2 = new System.Windows.Forms.PictureBox();  
  31.             this.lblDate = new System.Windows.Forms.Label();  
  32.             this.pictureBox1 = new System.Windows.Forms.PictureBox();  
  33.             this.lblTime = new System.Windows.Forms.Label();  
  34.             this.lbltnr = new System.Windows.Forms.Label();  
  35.             this.cmdEnemy = new System.Windows.Forms.Button();  
  36.             this.cmdTime = new System.Windows.Forms.Button();  
  37.             this.cmdInOut = new System.Windows.Forms.Button();  
  38.             this.label1 = new System.Windows.Forms.Label();  
  39.             this.menuStrip1 = new System.Windows.Forms.MenuStrip();  
  40.             this.arkivToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();  
  41.             this.anslutTillDatabasToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();  
  42.             this.bytAnvndareToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();  
  43.             this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();  
  44.             this.avslutaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();  
  45.             this.instllningarToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();  
  46.             this.funktionerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();  
  47.             this.visaInUtToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();  
  48.             this.visaTidslinjalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();  
  49.             this.visaMotstndarenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();  
  50.             this.statusStrip1 = new System.Windows.Forms.StatusStrip();  
  51.             this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);  
  52.             this.bytAnvndareToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();  
  53.             this.timerTnr = new System.Windows.Forms.Timer(this.components);  
  54.             this.timerClock = new System.Windows.Forms.Timer(this.components);  
  55.             this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();  
  56.             this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();  
  57.             this.panel1.SuspendLayout();  
  58.             ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();  
  59.             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();  
  60.             this.contextMenuStrip1.SuspendLayout();  
  61.             this.SuspendLayout();  
  62.             //   
  63.             // panel1  
  64.             //   
  65.             this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)  
  66.             | System.Windows.Forms.AnchorStyles.Left)));  
  67.             this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;  
  68.             this.panel1.Controls.Add(this.pictureBox2);  
  69.             this.panel1.Controls.Add(this.lblDate);  
  70.             this.panel1.Controls.Add(this.pictureBox1);  
  71.             this.panel1.Controls.Add(this.lblTime);  
  72.             this.panel1.Controls.Add(this.lbltnr);  
  73.             this.panel1.Controls.Add(this.cmdEnemy);  
  74.             this.panel1.Controls.Add(this.cmdTime);  
  75.             this.panel1.Controls.Add(this.cmdInOut);  
  76.             this.panel1.Controls.Add(this.label1);  
  77.             this.panel1.Location = new System.Drawing.Point(0, 24);  
  78.             this.panel1.Name = "panel1";  
  79.             this.panel1.Size = new System.Drawing.Size(134, 739);  
  80.             this.panel1.TabIndex = 1;  
  81.             //   
  82.             // pictureBox2  
  83.             //   
  84.             this.pictureBox2.Location = new System.Drawing.Point(7, 43);  
  85.             this.pictureBox2.Name = "pictureBox2";  
  86.             this.pictureBox2.Size = new System.Drawing.Size(39, 31);  
  87.             this.pictureBox2.TabIndex = 10;  
  88.             this.pictureBox2.TabStop = false;  
  89.             //   
  90.             // lblDate  
  91.             //   
  92.             this.lblDate.AutoSize = true;  
  93.             this.lblDate.Location = new System.Drawing.Point(48, 47);  
  94.             this.lblDate.Name = "lblDate";  
  95.             this.lblDate.Size = new System.Drawing.Size(22, 13);  
  96.             this.lblDate.TabIndex = 9;  
  97.             this.lblDate.Text = "Tid";  
  98.             this.lblDate.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;  
  99.             //   
  100.             // pictureBox1  
  101.             //   
  102.   
  103.             this.pictureBox1.Location = new System.Drawing.Point(7, 3);  
  104.             this.pictureBox1.Name = "pictureBox1";  
  105.             this.pictureBox1.Size = new System.Drawing.Size(39, 34);  
  106.             this.pictureBox1.TabIndex = 7;  
  107.             this.pictureBox1.TabStop = false;  
  108.             //   
  109.             // lblTime  
  110.             //   
  111.             this.lblTime.AutoSize = true;  
  112.             this.lblTime.Location = new System.Drawing.Point(48, 14);  
  113.             this.lblTime.Name = "lblTime";  
  114.             this.lblTime.Size = new System.Drawing.Size(22, 13);  
  115.             this.lblTime.TabIndex = 6;  
  116.             this.lblTime.Text = "Tid";  
  117.             this.lblTime.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;  
  118.             //   
  119.             // lbltnr  
  120.             //   
  121.             this.lbltnr.AutoSize = true;  
  122.             this.lbltnr.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));  
  123.             this.lbltnr.ForeColor = System.Drawing.Color.Blue;  
  124.             this.lbltnr.Location = new System.Drawing.Point(48, 59);  
  125.             this.lbltnr.Name = "lbltnr";  
  126.             this.lbltnr.Size = new System.Drawing.Size(21, 15);  
  127.             this.lbltnr.TabIndex = 5;  
  128.             this.lbltnr.Text = "tnr";  
  129.             this.lbltnr.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;  
  130.             //   
  131.             // cmdEnemy  
  132.             //   
  133.             this.cmdEnemy.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));  
  134.             this.cmdEnemy.Location = new System.Drawing.Point(4, 235);  
  135.             this.cmdEnemy.Name = "cmdEnemy";  
  136.             this.cmdEnemy.Size = new System.Drawing.Size(124, 39);  
  137.             this.cmdEnemy.TabIndex = 4;  
  138.             this.cmdEnemy.Text = "Motstndaren";  
  139.             this.cmdEnemy.UseVisualStyleBackColor = true;  
  140.             //   
  141.             // cmdTime  
  142.             //   
  143.             this.cmdTime.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));  
  144.             this.cmdTime.Location = new System.Drawing.Point(3, 174);  
  145.             this.cmdTime.Name = "cmdTime";  
  146.             this.cmdTime.Size = new System.Drawing.Size(124, 55);  
  147.             this.cmdTime.TabIndex = 3;  
  148.             this.cmdTime.Text = "Tidslinjal";  
  149.             this.cmdTime.UseVisualStyleBackColor = true;  
  150.             //   
  151.             // cmdInOut  
  152.             //   
  153.             this.cmdInOut.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));  
  154.             this.cmdInOut.ImageAlign = System.Drawing.ContentAlignment.TopCenter;  
  155.             this.cmdInOut.Location = new System.Drawing.Point(4, 113);  
  156.             this.cmdInOut.Name = "cmdInOut";  
  157.             this.cmdInOut.Size = new System.Drawing.Size(124, 55);  
  158.             this.cmdInOut.TabIndex = 2;  
  159.             this.cmdInOut.Text = "IN / UT";  
  160.             this.cmdInOut.TextAlign = System.Drawing.ContentAlignment.BottomCenter;  
  161.             this.cmdInOut.UseVisualStyleBackColor = true;  
  162.             //   
  163.             // label1  
  164.             //   
  165.             this.label1.BackColor = System.Drawing.Color.Gray;  
  166.             this.label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;  
  167.             this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));  
  168.             this.label1.ForeColor = System.Drawing.Color.White;  
  169.             this.label1.Location = new System.Drawing.Point(4, 92);  
  170.             this.label1.Name = "label1";  
  171.             this.label1.Size = new System.Drawing.Size(124, 18);  
  172.             this.label1.TabIndex = 1;  
  173.             this.label1.Text = "FUNKTIONER";  
  174.             this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;  
  175.             //   
  176.             // menuStrip1  
  177.             //   
  178.             this.menuStrip1.Location = new System.Drawing.Point(0, 0);  
  179.             this.menuStrip1.Name = "menuStrip1";  
  180.             this.menuStrip1.Size = new System.Drawing.Size(965, 24);  
  181.             this.menuStrip1.TabIndex = 2;  
  182.             this.menuStrip1.Text = "menuStrip1";  
  183.             //   
  184.             // arkivToolStripMenuItem  
  185.             //   
  186.             this.arkivToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {  
  187. this.anslutTillDatabasToolStripMenuItem,  
  188. this.bytAnvndareToolStripMenuItem,  
  189. this.toolStripMenuItem1,  
  190. this.avslutaToolStripMenuItem,  
  191. this.instllningarToolStripMenuItem});  
  192.             this.arkivToolStripMenuItem.Name = "arkivToolStripMenuItem";  
  193.             this.arkivToolStripMenuItem.Size = new System.Drawing.Size(43, 20);  
  194.             this.arkivToolStripMenuItem.Text = "Arkiv";  
  195.             //   
  196.             // anslutTillDatabasToolStripMenuItem  
  197.             //   
  198.   
  199.             this.anslutTillDatabasToolStripMenuItem.Name = "anslutTillDatabasToolStripMenuItem";  
  200.             this.anslutTillDatabasToolStripMenuItem.Size = new System.Drawing.Size(170, 22);  
  201.             this.anslutTillDatabasToolStripMenuItem.Text = "Anslut till databas";  
  202.             this.anslutTillDatabasToolStripMenuItem.Click += new System.EventHandler(this.anslutTillDatabasToolStripMenuItem_Click);  
  203.             //   
  204.             // bytAnvndareToolStripMenuItem  
  205.             //   
  206.   
  207.             this.bytAnvndareToolStripMenuItem.Name = "bytAnvndareToolStripMenuItem";  
  208.             this.bytAnvndareToolStripMenuItem.Size = new System.Drawing.Size(170, 22);  
  209.             this.bytAnvndareToolStripMenuItem.Text = "Byt anvndare";  
  210.             this.bytAnvndareToolStripMenuItem.Click += new System.EventHandler(this.bytAnvndareToolStripMenuItem_Click);  
  211.             //   
  212.             // toolStripMenuItem1  
  213.             //   
  214.             this.toolStripMenuItem1.Name = "toolStripMenuItem1";  
  215.             this.toolStripMenuItem1.Size = new System.Drawing.Size(167, 6);  
  216.             //   
  217.             // avslutaToolStripMenuItem  
  218.             //   
  219.   
  220.             this.avslutaToolStripMenuItem.Name = "avslutaToolStripMenuItem";  
  221.             this.avslutaToolStripMenuItem.Size = new System.Drawing.Size(170, 22);  
  222.             this.avslutaToolStripMenuItem.Text = "Anvndare";  
  223.             this.avslutaToolStripMenuItem.Click += new System.EventHandler(this.avslutaToolStripMenuItem_Click_1);  
  224.             //   
  225.             // instllningarToolStripMenuItem  
  226.             //   
  227.             this.instllningarToolStripMenuItem.Name = "instllningarToolStripMenuItem";  
  228.             this.instllningarToolStripMenuItem.Size = new System.Drawing.Size(170, 22);  
  229.             this.instllningarToolStripMenuItem.Text = "Instllningar";  
  230.             //   
  231.             // funktionerToolStripMenuItem  
  232.             //   
  233.             this.funktionerToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {  
  234. this.visaInUtToolStripMenuItem,  
  235. this.visaTidslinjalToolStripMenuItem,  
  236. this.visaMotstndarenToolStripMenuItem});  
  237.             this.funktionerToolStripMenuItem.Name = "funktionerToolStripMenuItem";  
  238.             this.funktionerToolStripMenuItem.Size = new System.Drawing.Size(70, 20);  
  239.             this.funktionerToolStripMenuItem.Text = "Funktioner";  
  240.             this.funktionerToolStripMenuItem.Click += new System.EventHandler(this.funktionerToolStripMenuItem_Click);  
  241.             //   
  242.             // visaInUtToolStripMenuItem  
  243.             //   
  244.             this.visaInUtToolStripMenuItem.Name = "visaInUtToolStripMenuItem";  
  245.             this.visaInUtToolStripMenuItem.Size = new System.Drawing.Size(174, 22);  
  246.             this.visaInUtToolStripMenuItem.Text = "Visa In/Ut ";  
  247.             this.visaInUtToolStripMenuItem.Click += new System.EventHandler(this.visaInUtToolStripMenuItem_Click);  
  248.             //   
  249.             // visaTidslinjalToolStripMenuItem  
  250.             //   
  251.             this.visaTidslinjalToolStripMenuItem.Name = "visaTidslinjalToolStripMenuItem";  
  252.             this.visaTidslinjalToolStripMenuItem.Size = new System.Drawing.Size(174, 22);  
  253.             this.visaTidslinjalToolStripMenuItem.Text = "Visa Tidslinjal";  
  254.             //   
  255.             // visaMotstndarenToolStripMenuItem  
  256.             //   
  257.             this.visaMotstndarenToolStripMenuItem.Name = "visaMotstndarenToolStripMenuItem";  
  258.             this.visaMotstndarenToolStripMenuItem.Size = new System.Drawing.Size(174, 22);  
  259.             this.visaMotstndarenToolStripMenuItem.Text = "Visa Motstndaren";  
  260.             //   
  261.             // statusStrip1  
  262.             //   
  263.             this.statusStrip1.ContextMenuStrip = this.contextMenuStrip1;  
  264.             this.statusStrip1.Location = new System.Drawing.Point(0, 741);  
  265.             this.statusStrip1.Name = "statusStrip1";  
  266.             this.statusStrip1.Size = new System.Drawing.Size(965, 22);  
  267.             this.statusStrip1.TabIndex = 4;  
  268.             this.statusStrip1.Text = "statusStrip1";  
  269.             //   
  270.             // contextMenuStrip1  
  271.             //   
  272.             this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {  
  273. this.bytAnvndareToolStripMenuItem1});  
  274.             this.contextMenuStrip1.Name = "contextMenuStrip1";  
  275.             this.contextMenuStrip1.Size = new System.Drawing.Size(157, 26);  
  276.             //   
  277.             // bytAnvndareToolStripMenuItem1  
  278.             //   
  279.   
  280.             this.bytAnvndareToolStripMenuItem1.Name = "bytAnvndareToolStripMenuItem1";  
  281.             this.bytAnvndareToolStripMenuItem1.Size = new System.Drawing.Size(156, 22);  
  282.             this.bytAnvndareToolStripMenuItem1.Text = "Byt anvndare";  
  283.             this.bytAnvndareToolStripMenuItem1.Click += new System.EventHandler(this.bytAnvndareToolStripMenuItem1_Click);  
  284.             //   
  285.             // timerTnr  
  286.             //   
  287.             this.timerTnr.Tick += new System.EventHandler(this.timer1_Tick);  
  288.             //   
  289.             // timerClock  
  290.             //   
  291.             this.timerClock.Interval = 1000;  
  292.             this.timerClock.Tick += new System.EventHandler(this.timerClock_Tick);  
  293.             //   
  294.             // toolStripStatusLabel1  
  295.             //   
  296.   
  297.             this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";  
  298.             this.toolStripStatusLabel1.Size = new System.Drawing.Size(67, 17);  
  299.             this.toolStripStatusLabel1.Text = "Databas:";  
  300.             //   
  301.             // toolStripStatusLabel2  
  302.             //   
  303.   
  304.             this.toolStripStatusLabel2.Name = "toolStripStatusLabel2";  
  305.             this.toolStripStatusLabel2.Size = new System.Drawing.Size(72, 17);  
  306.             this.toolStripStatusLabel2.Text = "Inloggad: ";  
  307.             //   
  308.             // frmMain  
  309.             //   
  310.             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);  
  311.             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;  
  312.             this.ClientSize = new System.Drawing.Size(965, 763);  
  313.             this.Controls.Add(this.statusStrip1);  
  314.             this.Controls.Add(this.panel1);  
  315.             this.Controls.Add(this.menuStrip1);  
  316.             this.IsMdiContainer = true;  
  317.             this.MainMenuStrip = this.menuStrip1;  
  318.             this.Name = "frmMain";  
  319.             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;  
  320.             this.Text = "HUGO";  
  321.             this.WindowState = System.Windows.Forms.FormWindowState.Maximized;  
  322.             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmMain_FormClosing);  
  323.             this.panel1.ResumeLayout(false);  
  324.             this.panel1.PerformLayout();  
  325.             ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();  
  326.             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();  
  327.             this.contextMenuStrip1.ResumeLayout(false);  
  328.             this.ResumeLayout(false);  
  329.             this.PerformLayout();  
  330.         }  
  331.         #endregion  
  332.         private System.Windows.Forms.Panel panel1;  
  333.         private System.Windows.Forms.MenuStrip menuStrip1;  
  334.         private System.Windows.Forms.Button cmdEnemy;  
  335.         private System.Windows.Forms.Button cmdTime;  
  336.         private System.Windows.Forms.Button cmdInOut;  
  337.         private System.Windows.Forms.Label label1;  
  338.         private System.Windows.Forms.StatusStrip statusStrip1;  
  339.         private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;  
  340.         private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel2;  
  341.         private System.Windows.Forms.ToolStripMenuItem arkivToolStripMenuItem;  
  342.         private System.Windows.Forms.ToolStripMenuItem anslutTillDatabasToolStripMenuItem;  
  343.         private System.Windows.Forms.ToolStripMenuItem bytAnvndareToolStripMenuItem;  
  344.         private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;  
  345.         private System.Windows.Forms.ToolStripMenuItem avslutaToolStripMenuItem;  
  346.         private System.Windows.Forms.ToolStripMenuItem funktionerToolStripMenuItem;  
  347.         private System.Windows.Forms.ToolStripMenuItem visaInUtToolStripMenuItem;  
  348.         private System.Windows.Forms.ToolStripMenuItem visaTidslinjalToolStripMenuItem;  
  349.         private System.Windows.Forms.ToolStripMenuItem visaMotstndarenToolStripMenuItem;  
  350.         private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;  
  351.         private System.Windows.Forms.ToolStripMenuItem bytAnvndareToolStripMenuItem1;  
  352.         private System.Windows.Forms.ToolStripMenuItem instllningarToolStripMenuItem;  
  353.         private System.Windows.Forms.Timer timerTnr;  
  354.         private System.Windows.Forms.Timer timerClock;  
  355.         private System.Windows.Forms.PictureBox pictureBox1;  
  356.         private System.Windows.Forms.Label lblTime;  
  357.         private System.Windows.Forms.Label lbltnr;  
  358.         private System.Windows.Forms.Label lblDate;  
  359.         private System.Windows.Forms.PictureBox pictureBox2;  
  360.   
  361.   
  362.     }  
  363. }  
 

Answers (1)