Reputation: 23
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
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