Click here to Skip to main content
11,642,855 members (69,980 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
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 11-Feb-13 7:58am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  

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

  Print Answers RSS
0 DamithSL 318
1 Sergey Alexandrovich Kryukov 250
2 OriginalGriff 240
3 jyo.net 180
4 Afzaal Ahmad Zeeshan 155
0 DamithSL 541
1 OriginalGriff 495
2 Mika Wendelius 469
3 Sergey Alexandrovich Kryukov 330
4 Afzaal Ahmad Zeeshan 324


Advertise | Privacy | Mobile
Web03 | 2.8.150731.1 | Last Updated 11 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100