954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How can I remove a checkbox from a panel through the Designer?

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.

SoftwareGuy
Light Poster
26 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
 

>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.

__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

That's it. Thanks a lot.

SoftwareGuy
Light Poster
26 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: