473,769 Members | 1,723 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Line spacing and DrawString??

I posted this to framework.drawi ng, 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 8843

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.publi c.dotnet.langua ges.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**********@go ogle.com
| NNTP-Posting-Date: Tue, 4 Nov 2003 22:11:15 +0000 (UTC)
| Path:
cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!new sfeed00.sul.t-online.de!t-onlin
e.de!news-spur1.maxwell.s yr.edu!news.max well.syr.edu!po stnews1.google. com!no
t-for-mail
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1967 42
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
| I posted this to framework.drawi ng, 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
3461
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 line spacing is very close (for example, when I use HTML in JLabels, or even in JTextAreas), but on the other Linux box, the line spacing is much wider. I'm using default Swing fonts -- I'm not setting anything. I can't find a field or function...
4
2959
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 finishing a long line. 2) The pages just look too wordy and it is tiring to read. I would think that there are already "formulas" for word count, lineheight
2
3700
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 from the bottom, to allow the line spacing of the following smaller font text to remain unaffected. I've always had to resort to a graphic for the leading capital - is there a way I can do this with css? Thanks John
7
7116
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 property. This works for IE6 but Opera7.54 and Netscape7.1 add large line spacing between the text blocks and any lines of wrapped text. The line spacing is independant of the font size and is consistent between all lines. ie: it's not larger...
5
2983
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 style="position:absolute; left:100px; top:100px; width:200px;>blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah <input type="text"...
4
3564
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 tested it on, except in IE6 for the PC. The spacing is completely inconsistent with all the other browsers. (See http://www.sunriveronline.org/misc/clrn ) Is there a way to include a few lines of code in my CSS file that will adjust IE6's...
1
3298
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) Problem Recreation : Download attached RAR file (http://download.yousendit.com/627919383AFAA7E3 ) Steps 1) Install RTF2 program created by Lebans 2) Install ZAN Image Printer (Virtual Printer) 3) Create Custom Paper Size ----...
12
1604
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
3714
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? Thanks,
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10211
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9994
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7408
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3958
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.