How to prevent wrapping text in a Label control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there

how can I prevent wrapping text in a Label control? I'd like the label to have a fixed length
so setting AutoSize to true is not an option for me. I'd prefer the label text to be cut when i
exceeds the specified length

Thanks in advance
Dmitry
 
Is it an option to just make the label the exact size you need? Or do you
need it to cut in the middle of a word? You could always paint the text
yourself using Graphics.DrawString.
 
In
how can I prevent wrapping text in a Label control? I'd like the label
to have a fixed length, so setting AutoSize to true is not an option for
me. I'd prefer the label text to be cut when it exceeds the specified
length.

If the height of the label is exactly the right height, it will ->appear
to truncate.

Of course once you've gone to the trouble to figure that out, I suppose
you could just as well clip the text yourself.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top