Adding elements to a form causes exception error

Bug reports.
Posts: 7
Joined: Fri Jun 13, 2014 7:08 pm
Location: Austin, Tx

Adding elements to a form causes exception error

Post by Grogimer » Fri Jun 13, 2014 9:17 pm

Really easy to reproduce this one.

Ranorex Version
.Net Runtime Version 4.0.30319.18444
Windows 7 Professional
  • Right click on project and select add new item
    Select C# folder
    Select Windows Applications
    Select Form from templates
    Click Create
    Close the new form1.cs (as the tabs are missing for source, history and design)
    Double click on form1.cs to reopen
    Click on Design
    Drag a label onto the form (Select View and then Tools if you do not have them up)
    Drag a textbox on the form
    Click Build.

You get the following error:
ICSharpCode.FormsDesigner.FormsDesignerLoadException: ICSharpCode.FormsDesigner.FormsDesignerLoadException: Syntax errors in

In the code it is placing the declarations for the textbox1 and label1 in the middle of the initialize component instead of at the beginning of the class. You can see in the code below.

Code: Select all

private void InitializeComponent()
			this.label1 = new System.Windows.Forms.Label();
			this.textBox1 = new System.Windows.Forms.TextBox();
			// label1
			this.label1.AutoSize = true;
		private System.Windows.Forms.TextBox textBox1;
		private System.Windows.Forms.Label label1;
			this.label1.Location = new System.Drawing.Point(120, 43);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(35, 13);
			this.label1.TabIndex = 0;
			this.label1.Text = "label1";
			// textBox1
			this.textBox1.Location = new System.Drawing.Point(101, 70);
			this.textBox1.Name = "textBox1";
			this.textBox1.Size = new System.Drawing.Size(100, 20);
			this.textBox1.TabIndex = 1;
			// Form1
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.ClientSize = new System.Drawing.Size(284, 262);
			this.Name = "Form1";
			this.Text = "Form1";

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Adding elements to a form causes exception error

Post by Support Team » Wed Jun 18, 2014 3:26 pm

Hi Grogimer,

Thank you for reporting. I’ve added an entry in our internal bug tracking system. A responsible colleague will analyze this problem in detail.

We are sorry for the inconvenience this may have caused.

Markus (S)