If you take a closer look at the generated code:
label1
this.label1 = new System.Windows.Forms.Label(); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(134, 163); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(35, 13); this.label1.TabIndex = 1; this.label1.Text = "label1";
pictureBox1
this.pictureBox1 = new System.Windows.Forms.PictureBox(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); // // pictureBox1 // this.pictureBox1.Location = new System.Drawing.Point(97, 75); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(100, 50); this.pictureBox1.TabIndex = 0; this.pictureBox1.TabStop = false;
I suppose that
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
changed by you to something like:
((System.ComponentModel.ISupportInitialize)(this.label1)).BeginInit();
which does not work, and leads to designer problems. Object does not match target type.
So, apply your changes, delete the lines, for example:
((System.ComponentModel.ISupportInitialize)(this.label1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.label1)).EndInit();
and I think you are good to go.
source share