473,401 Members | 2,139 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,401 software developers and data experts.

drawstring with line wrapping?

I need to use drawstring, but it always draws one line, and I need to divide
it. to give it a specified width which it doesnt cross, but starts another
line.
is it possible?

thanks
daniel
Nov 20 '05 #1
4 2534
DrawString is overloaded to allow a StringFormat to be used with it. Play
with that.
"Danie" <dc*****@gmx.net> wrote in message
news:Oz**************@TK2MSFTNGP12.phx.gbl...
I need to use drawstring, but it always draws one line, and I need to divide it. to give it a specified width which it doesnt cross, but starts another
line.
is it possible?

thanks
daniel

Nov 20 '05 #2
is it able to do what i want?
thanks

"Stephen" <gr******@bellatlantic.net> wrote in message
news:OG**************@TK2MSFTNGP10.phx.gbl...
DrawString is overloaded to allow a StringFormat to be used with it. Play
with that.
"Danie" <dc*****@gmx.net> wrote in message
news:Oz**************@TK2MSFTNGP12.phx.gbl...
I need to use drawstring, but it always draws one line, and I need to

divide
it. to give it a specified width which it doesnt cross, but starts another line.
is it possible?

thanks
daniel


Nov 20 '05 #3
"Danie" <dc*****@gmx.net> scripsit:
I need to use drawstring, but it always draws one line, and I need to divide
it. to give it a specified width which it doesnt cross, but starts another
line. is it possible?


\\\
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
e.Graphics.DrawString("Hello World Hello World Hello World", Me.Font, Brushes.Red, New RectangleF(0, 0, 40, 200))
End Sub
///

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
thanks
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bm************@ID-208219.news.uni-berlin.de...
"Danie" <dc*****@gmx.net> scripsit:
I need to use drawstring, but it always draws one line, and I need to divide it. to give it a specified width which it doesnt cross, but starts another line. is it possible?
\\\
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As

System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint e.Graphics.DrawString("Hello World Hello World Hello World", Me.Font, Brushes.Red, New RectangleF(0, 0, 40, 200)) End Sub
///

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

Nov 20 '05 #5

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

Similar topics

1
by: David Lindgren | last post by:
Hello! I am using the DrawString method with different StringAlignments passed to it and the result varies alot! Take a look at this screenshot:...
1
by: Drew | last post by:
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...
9
by: Fabio | last post by:
Hi all, I wonder if there is a way to get the bounds of each line drawn by the Graphics.DrawString() considering that DrawString() can wordwrap the text, so I cannot just consider the \n to...
5
by: johnb41 | last post by:
I need to print out a string of text and obviously i'm using the DrawString command. But the string must be placed AFTER some "programmatically generated text" (also printed using DrawString). ...
4
by: nothix9 | last post by:
Hello guys, Ive been working this for 2 days, I am required to position a string using drawstring but the problem is its dynamic and changes depending on the database or source. A quick fix I thought...
2
by: ChrisNightingale | last post by:
Hi everybody, I have an odd issue which I'm not sure how to resolve. I'm basically implementing a print mechanism which takes a series of controls and reproduces them on a print document. So...
4
by: Sin Jeong-hun | last post by:
Hello. It seems like the default behavior of DrawString is trying to keep the whole word if possible. I'd like the string to be drawn in multilines, but filling the entire line width. For example...
9
by: kynos | last post by:
I would like to paint a box using DrawString, standard Unicode characters (box drawings characters) and monospaced font. Unfortunately for some fonts painted lines contain a break. Example...
6
by: Dilip | last post by:
Howdy Folks I have a display where the Graphics.DrawString function is called to display something. Since the text seems to be larger than its bounding rectangle, the call basically splits the...
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
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
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.