We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Text Wrap "MultiLine Text" Ribbon button

I am trying to achieve a Multi-Line Text on a button with an image inside the ribbon control.

I can see that in the "ribbon merge" sample there are a couple of buttons that have the desired effect: "Conditional formatting", "Format as Table" etc.

where the image could be on top, to the right, or to the left and the button when is has a long text it will display the text on a MultiLine text wrap kind of layout instead of making the control as long as the text length.

How do i achieve this ? i have tried to find a property that allows me to do this and i can't find it. besides when i change the text on the "Ribbon Merge" samples (on the buttons where i see you do it) as soon as i add more text the buttons loose this type of formatting and come back to where the button becomes as big as the length of the text and look horrible.

What do you do to make this "Text Wrap" and can you do it code besides doing it on the designer so when you have a localized application and you need to change the text to another language the text will keep this "Text Wrap" formatting so the button does not loose its shape.

Look forward to your answer.


2 Replies

GA Gilles Angulo June 28, 2011 01:11 PM UTC

Well i guess you guys are Busy and have not have time to answer my question, and i have played a a couple of minutes with the issue so i will answer my own question:

There are 2 ways of doing this:

1) Through the designer. Just go the the text property where the text of the button in to be placed ("write the text you want"), then click on the drop-down in that field and where you want to have a new line just press the "Return" key until you have the text formatted the way you want too.

2) Through code: just place an "Environment.NewLine" where you want a new line on the text.

ex: toolStripButton34.Text = "Line 1" + Environment.NewLine + "Line 2" + Environment.NewLine + "Line 3";

That will give you a button with 3 lines of text:

Line 1
Line 2
Line 3

Thanks and i hope that this helps someone else

Gilles



IM Iniyen M A Syncfusion Team June 29, 2011 06:36 AM UTC

Hi Gilles,

Thanks for your interest in Syncfusion products.

We are glad to hear you have resolved your query, Our support policies differ for the different support we offer, You will receive faster assistance with our Direct-Trac support system. Please log incidents under the following link if you need any further assistance.

http://www.syncfusion.com/support/directtrac

We are glad to assist you

Regards,
Iniyen M.A.


Loader.
Live Chat Icon For mobile
Up arrow icon