473,387 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Line spacing and DrawString??

I posted this to framework.drawing, but did not get any responses...
Maybe here??

I am drawing some text using DrawString() and using a bounding
rectangle so that when the string is too long it wraps automatically.
I want to decrease the amount of space between the lines. How would I
go about changing the LineSpacing? The FontFamily has a read only
property.

Any ideas?
Nov 15 '05 #1
1 8799

Hi Drew,

Thanks for posting in this group.
It seems that .Net does not allow use to set linespacing property.
I think the only workaround is do the drawstring yourself. For example, you
should calculate the rectangle's width, then you should split your string
into several sectors.
For each string sector, you can use DrawString method to specify the
upper-left point of this string sector. This allows you to apply your
drawing logic.

Hope this helps,

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: dr******@yahoo.com (Drew)
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Subject: Line spacing and DrawString??
| Date: 4 Nov 2003 14:11:14 -0800
| Organization: http://groups.google.com
| Lines: 10
| Message-ID: <f7**************************@posting.google.com >
| NNTP-Posting-Host: 63.118.229.125
| Content-Type: text/plain; charset=ISO-8859-1
| Content-Transfer-Encoding: 8bit
| X-Trace: posting.google.com 1067983875 16996 127.0.0.1 (4 Nov 2003
22:11:15 GMT)
| X-Complaints-To: gr**********@google.com
| NNTP-Posting-Date: Tue, 4 Nov 2003 22:11:15 +0000 (UTC)
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-onlin
e.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!postnew s1.google.com!no
t-for-mail
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:196742
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| I posted this to framework.drawing, but did not get any responses...
| Maybe here??
|
| I am drawing some text using DrawString() and using a bounding
| rectangle so that when the string is too long it wraps automatically.
| I want to decrease the amount of space between the lines. How would I
| go about changing the LineSpacing? The FontFamily has a read only
| property.
|
| Any ideas?
|

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Hal Vaughan | last post by:
I'm testing a GUI app on a couple Linux boxen and one Win2k box. I'm using Java 1.4.2 on each (or the closest on Win2k -- whatever version comes close). On one Linux box and the Win2k box the...
4
by: Jeff Thies | last post by:
It seems that there can be too many words on a line. This is a problem with pages that are not fixed width. There seems to be a few problems. 1) Finding where the next line starts after...
2
by: John | last post by:
Now and again I like to start a sentence with a large capital, maybe in a different font. This upsets the line spacing and I've failed to find any css that will effectively crop the capital letter...
7
by: Danny | last post by:
I have a small <div> element which contains two text blocks - one within <h5> tags and the other within <p> tags. I don't want any extra line spacing between elements so use the display:inline...
5
by: Andrew Poulos | last post by:
If I have a text INPUT within a block of text how do I 'correct' for the line spacing. The line spacing above and below the INPUT is larger than the line spacing generally: <div...
4
by: fleemo17 | last post by:
Is there a way to tweak the spacing of lines of text (or leading) *specifically* in IE6? I've created a "Quick Search" box in my layout which renders pretty consistently in all the browsers I've...
1
by: replyrpatil | last post by:
What I am trying to do: I need to print a compact access report (font 6 size) created using RTF2 program developed by Stephen Lebans to generate a TIF image of custom size (5.5 in x 2.0 in) ...
12
by: Dom | last post by:
VB had a "line" control, just a simple line that let you separate controls without the wasted space of a Groupbox. Did CSharp drop this? Dom
6
by: shapper | last post by:
Hello, I created the following header: http://www.27lamps.com/Beta/Typography/Typography.html Where Font Size is the same as Line Height: 2.0em. Shouldn't the border be next to the text? ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.