IDE Removing Code on Compile :(

  • Thread starter Thread starter John Baro
  • Start date Start date
J

John Baro

I have experienced a couple of times that when I compile a project it
removes settings from controls

This is the code for a label that WAS identical to the label below

If it makes a difference the one that "disappeared" was copied and a new one
was pasted and edited. (The one that disappeared was the source of the copy)

//Source Label
this.lblILegend.Location = new System.Drawing.Point(0, 0);
this.lblILegend.Name = "lblILegend";
this.lblILegend.TabIndex = 0;

Where is the rest of it?

//Pasted label (destination)
this.lblKPILegend.AutoSize = true;
this.lblKPILegend.BackColor = System.Drawing.Color.MistyRose;
this.lblKPILegend.BorderStyle =
System.Windows.Forms.BorderStyle.FixedSingle;
this.lblKPILegend.Location = new System.Drawing.Point(216, 0);
this.lblKPILegend.Name = "lblKPILegend";
this.lblKPILegend.Size = new System.Drawing.Size(26, 20);
this.lblKPILegend.TabIndex = 947;
this.lblKPILegend.Text = "KPI";
this.lblKPILegend.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;


TIA
JB :(

What is the question?
That is the question.
 
The label will also no longer show up in intellisense

When I close the IDE and reopen it comes back in intellisense but not the
rest of the settings

Using MS VSNET 2003.
 
John said:
I have experienced a couple of times that when I compile a project it
removes settings from controls
[...]

It's hard to understand what you're asking -- are you modifying code
within the auto-generated 'InitializeComponent' method?
 
Sorry

Not modifying anything.

Workflow:

Copy Control
Paste Control
Modify Pasted Controls properties using the property editor.
Compile

Usually it displays right after compile but then when I go back into design
mode the Copied control "disappears".
ie the settings are removed from the 'InitializeComponent' method.

I resorted to removing all (four) the controls that I had copied from others
and adding them individually from the toolbox.
This worked fine but I have to then go and set all the common properties for
them all.
Multi-Select and set common properties is great but not a easy as copy -
paste.

JB

C# Learner said:
John said:
I have experienced a couple of times that when I compile a project it
removes settings from controls
[...]

It's hard to understand what you're asking -- are you modifying code
within the auto-generated 'InitializeComponent' method?
 
Back
Top