paint event...how i can maintain the allingment..of text

prashantsvl

Member
Joined
Jul 24, 2008
Messages
10
Programming Experience
Beginner
dear

used the following code at paint event..

u will geting som ideas.....

VB.NET:
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
 
For cc As Integer = 0 To 50
[COLOR="Red"]e.Graphics.DrawString(Strings.Left("chinmay is a good boy. His telephone number is 98231xxxxxx. He is very handsome and smart.", (cc * 1.8)), Me.Font, Brushes.Red, 0, cc * 15)
[/COLOR]Next
 
End Sub


this code print the text on form..
but write now i facing difficulty the out put text not in sequece

ex: abcdefg the resultant text..

abc def g

why there is space ? and how i can maintain the allingment..of text
 
the output graphics text not giving formated out put

and the out put text are in scaterd form..

Untitled.png

so any code .....?.plz help me..:)
 
So what exactly is the issue? It looks like all that's going on is that the text is all stacked on top of each other because your current code doesn't vertically move the text down on the form when it draws the next line in the loop.
 
paint the text..

hi
experts:)

yes it is corect the code not vertical work .. but then why its not
overrite the existing string output...

example..

"hello ....." this string why not print as it is though it is in loop...?


wating for replay..

thanks

regards
prashant:)
 
You're drawing partly the same text over and over at different locations. Instead draw one and one character.
 
graphics replay..

hi

i got ans..

to alling the graphics text u have to insert one line with event handler..

g.Graphics.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAlias
the text print with formated output...
 
Back
Top