Dim text1 As String = "Draw text in a rectangle by passing a RectF to the DrawString method."
Dim font1 As New Font("Arial", 12, FontStyle.Bold, GraphicsUnit.Point)
Try
Dim rectF1 As New RectangleF(30, 10, 100, 122)
e.Graphics.DrawString(text1, font1, Brushes.Blue, rectF1)
e.Graphics.DrawRectangle(Pens.Black, Rectangle.Round(rectF1))
Finally
font1.Dispose()
End Try
Dim stringFormat As New StringFormat
stringFormat.Alignment = StringAlignment.Center
stringFormat.LineAlignment = StringAlignment.Center
Dim stringOPayment As New StringFormat
stringOPayment.Alignment = StringAlignment.Center
stringOPayment.LineAlignment = StringAlignment.Center
Dim LBOPayment As New RectangleF(30, 188, 24, 24)
Dim BCBrush8 As New SolidBrush(Color.Red)
Dim rect8 As New Rectangle(30, 188, 24, 24)
e.Graphics.FillRectangle(BCBrush8, rect8)
e.Graphics.DrawString(Label8.Text, fontOPayment, Brushes.Black, LBOPayment, stringOPayment)
e.Graphics.DrawRectangle(Pens.Red, Rectangle.Round(LBOPayment))