Question change the style of the group box

Mehran

Member
Joined
Aug 18, 2021
Messages
7
Programming Experience
Beginner
32.png

How can I change the style of the groupbox exactly like what you see in the picture?
Similar to the part I highlighted in the image
 
Solution
Why do you have to change the style of a group box? Why not just draw things using GDI or GDI+? Since WinForms is just a thin wrapper around Win32, you get the default Win32 rendering of controls. The normal way to override a Win32 control rendering is to make it an owner drawn control. When you start doing owner drawn painting, you'll use GDI and/or GDI+. If all you need to do is a one-off drawing, why even do through the trouble of doing an owner drawn static control? Just draw it directly as part of the window paint of the parent window/form.
Why do you have to change the style of a group box? Why not just draw things using GDI or GDI+? Since WinForms is just a thin wrapper around Win32, you get the default Win32 rendering of controls. The normal way to override a Win32 control rendering is to make it an owner drawn control. When you start doing owner drawn painting, you'll use GDI and/or GDI+. If all you need to do is a one-off drawing, why even do through the trouble of doing an owner drawn static control? Just draw it directly as part of the window paint of the parent window/form.
 
Solution
@titojd : Unfortunately, your link is for WPF, but the question was about WinForms.
 
Back
Top Bottom