using System;
using System.Windows.Forms;    
using System.Drawing;
                                                       
public class HelloWorld : System.Windows.Forms.Form
{                                                       // our Form class
        public HelloWorld()                     // the constructor
        {
                this.Text = "Hello World";     // Set this form’s Text Property
                this.Paint += new PaintEventHandler(MyPaintHandler);
        }

        static void Main()                         // Application’s entry point 
        {
                Application.Run(new HelloWorld());   // Run the form
        }

        private void MyPaintHandler(object objSender, PaintEventArgs pea)
        {
                Graphics g = pea.Graphics;
                g.Clear(Color.Yellow);
                g.DrawString("Hello, World", this.Font, Brushes.Black, 10, 10);
                Brush br1 = new SolidBrush(Color.FromArgb(0,0,255));
                g.DrawString("Hello, World", this.Font, br1, 10, 30);
                Brush br2 = new SolidBrush(Color.Red);
                g.DrawString("Hello, World", this.Font, br2, 10, 50);
                br1.Dispose();
                br2.Dispose();
        }
}