views:

249

answers:

4

Basically, i am creating a button in Oval shape. But my button label is too long to display in one line. So i wanted to split in to multiple lines. So the Oval button looks good.

My Problem is, How to enable word wrap on a Button?

Any suggestions?

+1  A: 

What if you just add newline in the text at the place where it should split?

Giorgi
It's not working. I tried that also.
Dinesh
@Dimesh, and if you make your button a little bigger (or test with a smaller font)?
Henk Holterman
+1  A: 

Try to add "\n" to button's Text property in the places you want to wrap.

nihi_l_ist
\r\n is also working. But \n alone is not working for me.
Dinesh
+1  A: 

Set the label text on form load and add Environment.Newline as the newline string, like this:

btnOK.Text = "OK" + Environment.NewLine + "true";
Rox
A: 

two options

  1. If you are creating a custom control , then place a label control on it with Autosize = true option. and adjust its size as per the buttons size.
  2. Next way is a bit crude as you need to add new line wherever you want.
Ram