Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you fix the height and width of a winforms label to accept variable length text

I have created a wizard form and each page of the form will display some help text.

I either need a

1.Label control where I can fix the height and width of the label so it doesn't grow to long but rather wraps the text inside my fixed width and height.

But a label doesn't have sizing handles and seems to automatically adjust to the content.

OR

2.A textbox control (where I can already set the height and width if I set multiline off) however the user should NOT be able to edit the textbox...in fact the textbox should not be able to recieve the focus at all. (like a label)

Can someone tell me how to do one or the other.

Seth B Spearman

like image 502
Seth Spearman Avatar asked Jul 23 '09 04:07

Seth Spearman


1 Answers

For Label, You should set label's Autosize property to false

For Textbox, set Enabled Property to false

like image 144
Sumit Deo Avatar answered Oct 05 '22 08:10

Sumit Deo