Hackoo86
Hackoo86

Reputation: 23

Winforms label text not showing completely

Here is the code I am using to add a label to a simple form:

Label myLabel = new Label();
myLabel.Text = "Hello how are you This is an example label in my first form";
myLabel.Location = new Point(50,20);

Here when the form is run, the label shows up, but partially, the all text does not show. How to make the full label text show up in the form?

Thanks in advance

Upvotes: 2

Views: 918

Answers (1)

Wasif
Wasif

Reputation: 15470

I think you are missing the AutoSize property. By making that true, the label text will automatically size and completely show up. Add this:

myLabel.AutoSize = true;

Upvotes: 3

Related Questions