How can I get back my lost Checkboxes (after moving them from the Form to the Panel)?

72 views Asked by At

I placed several panels on my form. When I clicked the central panel in the designer, the main form was what was actually selected (even though the panel should be on top of it, and the main form should not be (easily) clickable in the designer).

By the way, clicking the other panels on the form don't have this problem (all of the other panels are on top of the form).

Because of the form being clicked when I expected that I was clicking the panel, when I added several controls to what I thought was the panel (after successfully adding some labels on top of the panel), all of these controls (checkboxes) ended up on the form / below the panel, so that they don't display at runtime:

enter image description here

When I realized that the controls were on the form, and not on the panel, I selected the form from the Property browser, selected all of the checkboxes at once, and cut the group of them.

I then selected the main panel from the Property Browser, and pasted those cut checkboxes onto the panel. It sort of worked, but all I saw was their outline (all selected together). I used the Ctrl+Up arrow to move them in a body up on the panel, a little at a time, until they were all near the top where they belong. But then they just disappeared.

From now on I will make sure to right-click the panel and select "BringToFront" before adding any controls to that area; for now, though, I don't see the checkboxes on either the form or the panel. How can I get them back (and place them on the panel), and prevent the form from ever appearing on top of the panel (except if/when I select it from the Property browser)?

The checkboxes do still exist, although their names were changed from "ckbxAll" etc. to Checkbox1, etc. They appear on the correct panel in Form1Designer.cs, but do not display. Here is how they are represented there:

// panelMain
// 
this.panelMain.BackColor = System.Drawing.Color.White;
this.panelMain.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.panelMain.Controls.Add(this.checkBox21);
this.panelMain.Controls.Add(this.checkBox20);
this.panelMain.Controls.Add(this.checkBox19);
this.panelMain.Controls.Add(this.checkBox18);
this.panelMain.Controls.Add(this.checkBox17);
this.panelMain.Controls.Add(this.checkBox16);
this.panelMain.Controls.Add(this.checkBox15);
this.panelMain.Controls.Add(this.checkBox14);
this.panelMain.Controls.Add(this.checkBox13);
this.panelMain.Controls.Add(this.checkBox12);
this.panelMain.Controls.Add(this.checkBox11);
this.panelMain.Controls.Add(this.checkBox10);
this.panelMain.Controls.Add(this.checkBox9);
this.panelMain.Controls.Add(this.checkBox8);
this.panelMain.Controls.Add(this.checkBox7);
this.panelMain.Controls.Add(this.checkBox6);
this.panelMain.Controls.Add(this.checkBox5);
this.panelMain.Controls.Add(this.checkBox4);
this.panelMain.Controls.Add(this.checkBox3);
this.panelMain.Controls.Add(this.checkBox2);
this.panelMain.Controls.Add(this.checkBox1);
this.panelMain.Location = new System.Drawing.Point(160, 0);
this.panelMain.Name = "panelMain";
this.panelMain.Size = new System.Drawing.Size(639, 740);
this.panelMain.TabIndex = 2;
// 

UPDATE

It turns out they ARE there, but they are invisible now (except for their outlines when I click on them):

enter image description here

0

There are 0 answers