Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent word wrap in label with AutoSize=false

Tags:

c#

winforms

How to prevent word wrapping in Label control in designer mode, while it's auto size is set to false?

Basically I want to freely move and resize label in designer mode, but its text should be always in one line (cut if needed).

Thanks for any help!

like image 732
zgorawski Avatar asked Dec 18 '12 14:12

zgorawski


People also ask

How do I stop word from wrapping text?

Enable or disable text wrapping for a text box, rich text box, or expression box. Right-click the control for which you want to enable or disable text wrapping, and then click Control Properties on the shortcut menu. Click the Display tab. Select or clear the Wrap text check box.

How do I turn off word wrap in CSS?

To prevent the text from wrapping, you can use the CSS white-space property with the “nowrap” or “pre” value.

How do I adjust text wrap?

Configure text wrapping around a picture or drawing object Select the picture or object. Go to Picture Format or Shape Format and select Arrange > Wrap Text. If the window is wide enough, Word displays Wrap Text directly on the Picture Format tab. Choose the wrapping options that you want to apply.

What is word wrapping manipulation?

What is word wrapping manipulation? Line breaking, also known as word wrapping, is breaking a section of text into lines so that it will fit into the available width of a page, window or other display area.


1 Answers

Do you want to prevent it only in designer mode or also at runtime?

As you mentioned 'cut if needed!'

I suggest you to look at: Label.AutoEllipse

like image 106
codeteq Avatar answered Oct 04 '22 09:10

codeteq