textbox with align right in print VB

1

I have a printdocument with the following command

Dim font1 As New Font("Arial", 15, FontStyle.Regular)
e.Graphics.DrawString(txtnome.Text, font1, Brushes.Black, 10, 10)

And when I print the textbox it goes from left to right, even with the textbox property with textalign: right.

How do I make the print look the same in the textbox with the text coming from right to left?

    
asked by anonymous 11.04.2018 / 19:49

1 answer

0

I think the StringFormat parameter is able to solve your problem:

Dim sf As StringFormat = New StringFormat()
Dim font1 As New Font("Arial", 15, FontStyle.Regular)

sf.LineAlignment = StringAlignment.Far
sf.Alignment = StringAlignment.Far

e.Graphics.DrawString(txtnome.Text, font1, Brushes.Black, 10, 10, sf)
    
01.08.2018 / 13:19