Click here to Skip to main content
12,353,095 members (70,936 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160621.1 | Last Updated 11 Feb 2013
Copyright © CodeProject, 1999-2016
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