在我的项目中,有一个toolStrip
元素,在Resources.resx文件中修改后表现得很奇怪。无论我做什么:添加新的bitmap
,删除旧的bitmap
,更改Display style of dropdown buttons
...每次收到错误消息时,表单中都没有toolStrip
我的Form.Designer.cs
接下来会发生:
在修改代码之前:
//
// toolStrip1
//
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripDropDownButton1,
this.toolStripSeparator4,
this.toolStripDropDownButton2});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(1584, 27);
this.toolStrip1.TabIndex = 347;
this.toolStrip1.Text = "toolStrip1";
后:
//
// toolStrip1
//
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(1584, 27);
this.toolStrip1.TabIndex = 347;
this.toolStrip1.Text = "toolStrip1";
修改前我的DropDownButton:
//
// toolStripDropDownButton1
//
this.toolStripDropDownButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.ImageAndText;
this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.openFileToolStripMenuItem,
this.saveCalculationsFileToolStripMenuItem,
this.saveRawCalculationsFileToolStripMenuItem});
this.toolStripDropDownButton1.Image = global::Project_Tribo_v._0._2.Properties.Resources.folder_document;
this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripDropDownButton1.Name = "toolStripDropDownButton1";
this.toolStripDropDownButton1.Size = new System.Drawing.Size(61, 24);
this.toolStripDropDownButton1.Text = "File";
之后:
//
// toolStripDropDownButton1
//
this.toolStripDropDownButton1.Image = global::Project_Tribo_v._0._2.Properties.Resources.folder_document;
this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripDropDownButton1.Name = "toolStripDropDownButton1";
this.toolStripDropDownButton1.Size = new System.Drawing.Size(61, 24);
this.toolStripDropDownButton1.Text = "File";
这不是一个大问题,虽然我有少量的toolStrip元素,但stil ......
任何想法如何避免或修复这个?