.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Code Snippets >> Windows Form Controls >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Drawing Text on a Windows Form.

Posted By:Prasanti Prusty       Posted Date: February 27, 2010    Points: 10    Category: Windows Form Controls    URL: http://www.dotnetspark.com  

Drawing Text on a Windows Form.

'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


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend