Open In App

How to Add Text in the GroupBox in C#?

In Windows Forms, GroupBox is a container which contains multiple controls in it and the controls are related to each other. Or in other words, GroupBox is a frame display around a group of controls with a suitable optional title. Or a GroupBox is used to categorize the related controls in a group. In GroupBox, you can add text in the GroupBox in the form using Text Property. You can set this property in two different ways:

1. Design-Time: It is the easiest way to add text in the GroupBox as shown in the following steps:



2. Run-Time: It is a little bit trickier than the above method. In this method, you can add text in the GroupBox control programmatically with the help of given syntax:

public override string Text { get; set; }

The following steps show how to add text in the GroupBox dynamically:


Article Tags :
C#