I’m using C#. Sometimes the text returned from a web service (which I display in a label) is too long and gets cut off on the edge of the form. Is there an easy way to add a newline to the label if it’s not going to fit on the form?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you set the label to
autosize, it will automatically grow with whatever text you put in it.In order to make it word wrap at a particular width, you can set the MaximumSize property.
Tested and works.
If you always want to be able to see the data, you can set the Label’s container’s
AutoScrollproperty to true.