Click here to Skip to main content
15,884,353 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using a TextBox on a windows form.
I need to modify the distance between lines regardless of font size on this textbox.
Is it possible to change line spacing?
Thanks in advance.
Posted

Line spacing in the TextBox controls is fixed and you can't change it. If you need it try creating your own control and painting the contents yourself : http://social.msdn.microsoft.com/forums/en-US/winforms/thread/b6311cca-2ac4-4e21-9b74-b4860a719615[^]
 
Share this answer
 
No. The TextBox control has no styling options, other than the font size - which applies to the whole text, and not part of it.
You can probably do it with a RichTextBox, by using the Windows API to send the control an EM_SETPARAFORMAT message - but I've never tried and I don't know how well it would work.

Probably, your best bet is to write your own control that supports it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900