Click here to Skip to main content
11,583,865 members (66,513 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 OriginalGriff 430
1 Dave Kreskowiak 230
2 Richard Deeming 220
3 Sergey Alexandrovich Kryukov 220
4 virusstorm 203
0 OriginalGriff 1,523
1 Sergey Alexandrovich Kryukov 995
2 Abhinav S 696
3 Dave Kreskowiak 621
4 Suvendu Shekhar Giri 568


Advertise | Privacy | Mobile
Web03 | 2.8.150603.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