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


Top 5 Contributors of the Month
david stephan

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

 Subscribe to Code Snippets

Drawing Text on a Windows Form using ResizeRedraw Property.

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 using ResizeRedraw Property.
 



Drawing Text on a Windows Form using ResizeRedraw Property.
Drawing Text on a Windows Form Using the Drawing Method of the Graphics Class and ResizeRedraw Property.
ResizeRedraw : It true if the control redraws itself when resized; otherwise, false.
The form constantly modifies the text as it is resized.

Public Class frmResizeRedraw

    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

    'Constructor of the Form
    Public Sub New()

        ' This call is required by the Windows Form Designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.

        'Paint When Resized
        Me.ResizeRedraw = True

    End Sub
End Class


     

Further Readings:

Responses

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