visual studio .net debugging:
I have run into a problem that I can't understand and it is becoming
really annoying.
The problem occurs when I compile my solution. When compiling the
IDE(?) sometimes removes properties that are set in the "Designer
generated code" region.
Let me give you an example...
In one of my forms I have a standard TabControl, placed on the form by
draging and dropping from the toolbox. It has the Dock property set to
'Fill'. Two TabPage's have been added to the TabControl by clicking on
the TabPages property in the Properties Windows. On both of these tab
pages there are other control's (textbox, datagrid etc).
When compiling something happen. The TabControl is nolonger filling my
form, it's possitioned in the upper left corner of the form and it has
no TabPages.
Looking in "Designer generated code" region I have the following code
:
//
// tabControl1
//
this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.TabIndex = 0;
//
// tabPage1
//
this.tabPage1.Location = new System.Drawing.Point(0, 0);
this.tabPage1.Name = "tabPage1";
this.tabPage1.TabIndex = 0;
//
// tabPage2
//
this.tabPage2.Location = new System.Drawing.Point(0, 0);
this.tabPage2.Name = "tabPage2";
this.tabPage2.TabIndex = 0;
Normally i.e. the TabControl has more properties set like this...
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Size = new System.Drawing.Size(410, 335);
etc...
Looking further in the "Designer generated code" region, all control's
that has been draged-and-dropped on to the form has its Location
property set to System.Drawing.Point(0, 0). Unfortunately, I don't
know which properties that are normally set by the IDE so I don't know
which other properities are changed or is missing/removed.
Has anyone else had this problem?
What am I doing wrong?
How can I fix this? Is there a "undo" for this? Today I have to
re-create the form :(
Thanks!
BR