After copying and pasting controls, compiling app removes them

R

Ryan Taylor

Urghhhh. I am having a hard time with Visual Studio .NET 2003. I am
developing a WindowForms application in C#. I had a Form that with a few
controls on it (a left docked panel with 4 top docked buttons with images).
I selected the panel, cut and pasted it into a usercontrol I was building.
It looked fine and docked fine. I then added some panels left docked and top
docked just to make some gutter space. I had to change the order in which
they were added to make then dock the way I wanted. Now whenever I compile
the application the buttons are removed from the designer, yet the button
declarations still exist. So I remove the declarations, re-create the
buttons and compile. Same thing. What is going on here?

Thanks in advance.
Ryan "Frustrated" Taylor
 
R

Ryan Taylor

Some additional information. This is how my button code is declared by the
designer. Interestingly enough, the btnDatabase does not get removed on
compile but the btnBins does.

private System.Windows.Forms.Button btnBins;

private void InitializeComponent()
{
// ... some other controls
this.btnBins = new System.Windows.Forms.Button();

//
// pnlBins
//
this.pnlBins.Controls.Add(this.binConfig);
this.pnlBins.Location = new System.Drawing.Point(464, 104);
this.pnlBins.Name = "pnlBins";
this.pnlBins.Size = new System.Drawing.Size(288, 296);
this.pnlBins.TabIndex = 5;
this.pnlBins.Visible = false;

//
// pnlToolbar
//
this.pnlToolbar.BackColor = System.Drawing.SystemColors.Control;
this.pnlToolbar.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pnlToolbar.Controls.Add(this.btnBins);
this.pnlToolbar.Controls.Add(this.btnDatabase);
this.pnlToolbar.Dock = System.Windows.Forms.DockStyle.Left;
this.pnlToolbar.Location = new System.Drawing.Point(0, 37);
this.pnlToolbar.Name = "pnlToolbar";
this.pnlToolbar.Size = new System.Drawing.Size(84, 699);
this.pnlToolbar.TabIndex = 9;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top