Click here to Skip to main content
12,895,135 members (56,888 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
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 :[^]
Rate this: bad
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.

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
Web01 | 2.8.170424.1 | Last Updated 11 Feb 2013
Copyright © CodeProject, 1999-2017
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