Drawing Text on a Windows Form.

Posted by Chikul under Windows Forms category on | Views : 1620

'Drawing Text on a Windows Form.
'Drawing Text on a Windows Form Using the Drawing Method of the Graphics Class.

Public Class frmDrawText

Private Sub frmDrawText_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
'Create the Object of Graphics Class
Dim grpx As Graphics = e.Graphics
Dim strText As String = String.Format("My Form Size is : Width = {0} , Height = {1}", Width, Height)
grpx.DrawString(strText, Font, Brushes.Black, 0, 0)
End Sub

End Class

Comments or Responses

Login to post response