Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.Windows.Forms.GroupBox hide frame

Tags:

c#

winforms

On the System.Windows.Forms.GroupBox, is there any way to hide frame around it? I tried changing the FlatStyle but that does not do what I want. Thanks!

like image 778
Luis Garcia Avatar asked Feb 25 '13 15:02

Luis Garcia


People also ask

Can a GroupBox display a caption?

The GroupBox control is similar to the Panel control; however, only the GroupBox control displays a caption, and only the Panel control can have scroll bars.

What is GroupBox?

The GroupBox displays a frame around a group of controls with or without a caption. Use a GroupBox to logically group a collection of controls on a form. The group box is a container control that can be used to define groups of controls.

How do I add controls to GroupBox?

To create a group of controls If you have existing controls that you want to enclose in a group box, you can select all the controls, cut them to the Clipboard, select the GroupBox control, and then paste them into the group box. You can also drag them into the group box.


2 Answers

A Panel is probably a better option, but if you really need a GroupBox for some reason, you can modify the code here to create a subclass which doesn't paint the border at all. Specifically, you'll want to override the OnPaint method.

like image 138
Bobson Avatar answered Sep 29 '22 06:09

Bobson


As far as I know this is not possible.

Try using a panel instead.

You could put a label at the top if you want and they practically do the same thing.

like image 39
Toon Casteele Avatar answered Sep 29 '22 05:09

Toon Casteele