0

Hi. This is probably too easy, but... Can anyone tell me how to add or remove a checkbox from a panel by using the Designer? The only samples I could find online had the code nside an arbitrary method called CreateMyPanel().

I'm looking at a file called MyControl.Designer.cs, and inside InitializeComponent() I see the code:

this.panel1.Controls.Add(this.checkBox1);

Now I would like to remove it, but by using the Designer, since it's recommended not to manually modify the designer-generated file.

Can anyone tell me how to remove that checkbox from the panel through the Designer UI?

Thanks.

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by SoftwareGuy
1

>Can anyone tell me how to remove that checkbox from the panel through the Designer UI?

Correct me if I'm wrong. When you dragged a "checkbox" in designer (view) mode outside that panel, code this.panel1.Controls.Add(this.checkBox1); will be removed automatically from the designer.cs.

Votes + Comments
Not only knowledgeable, but quite modest, too...
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.