Mega Code Archive

 
Categories / C# Tutorial / GUI Windows Forms
 

FormPaint Event

using System;         using System.Drawing; using System.Windows.Forms; public class FormPaintEvent : Form {   public FormPaintEvent()   {     Size = new Size(300,200);     Paint += new PaintEventHandler(PaintHandler);   }   static void Main()    {     Application.Run(new FormPaintEvent());   }   private void PaintHandler(object sender, PaintEventArgs e)   {     Graphics g = e.Graphics;     g.DrawString("www.rntsoft.com", Font, Brushes.Black, 50, 75);   } }