How can I change the border thickness of a Groupbox on a windows form in C#?

前端 未结 2 1045
梦毁少年i
梦毁少年i 2021-01-19 08:56

I didn\'t find any solution that helped me on the older questions on SO... Is it possible to make them thicker or just more visible by changing the color? If yes, some code

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-19 09:34

    GroupBox is a custom drawn .Net control. You will need to hook into the Paint event, or derive from the GroupBox and override the OnPaint method, determine where the existing lines are being drawn and then draw overtop of them with wider lines to achieve the thicker border. Or you can create a custom control and paint everything yourself.

提交回复
热议问题