Hello,
A simple, yet annoying one....
I have made a new GroupBox in that contains all my controls (buttons, listboxes, textboxes, etc.).
I wish now to delete the GroupBox which I find impossible.
Whenever I try to delete it, it deletes all its contents.
I have tried to directly delete it by 'delete', I tried by removing its code, I tried shrinking it, but nothing seems to help.
Does anyone know how to get rid of this GroupBox while keeping all its controls?
Thanks,
Sam
Loading

Kirtan PatelRank #292 · 8.6K reputationPosted Jan 12, 2010, 3:50 AM EST
I know how to remove it without affecting all controls inside it .its some complected process but it can be done
just Attach Your Project Files(zip) Here .
Sam159 reputationPosted Jan 12, 2010, 4:48 AM EST
Thanks for replying.
Unfortunately my code is very large, and I guess you need the whole project (with the Designer file).
I therefore prepared a minimal form with one button and one GroupBox, and I hope you can demonstrate the removal on that demo.
Thanks in advance,
Sam
Kirtan PatelRank #292 · 8.6K reputationPosted Jan 12, 2010, 7:23 AM EST
please check "Do you like this answer" check box it helps me :)
For Example Below is My Form
Step 1 :
--------------
Go to Designer Code :
Remove Below Code as Mentioned in below image
Step 2
--------------
Now you will have code like below after deleting Some code in Step1
Step 3:
----------
Delete all other code lines with word "GroupBox1". you can do this easily by find Feature of Visual studio to locate lines
This below Final result : I have Removed Group Box Without Affecting Control Positions :
Sam159 reputationPosted Jan 12, 2010, 8:08 AM EST
Perfect and detaild reply.
It was not easy (I have over 80 controls in the form!(, but with your explanation it was perfect.
Thanks.