Draw String : Graphics : Drawing 2D C# Examples


C# Examples » Drawing 2D » Graphics »

 

Draw String









    
using  System;
using  System.Drawing;
using  System.Windows.Forms;
class  PaintHello
{
          public  static  void  Main()
          {
                    Form  form            =  new  Form();
                    form.Text            =  "Paint  Hello";
                    form.BackColor  =  Color.White;
                    form.Paint        +=  new  PaintEventHandler(MyPaintHandler);
      
                    Application.Run(form);
          }
          static  void  MyPaintHandler(object  objSender,  PaintEventArgs  pea)
          {
                    Form          form  =  (Form)objSender;
                    Graphics  graphics  =  pea.Graphics;
      
                    graphics.DrawString("Hello,  world!",  form.Font,  Brushes.Black,  0,  0);
          }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Drawing 2D
» Graphics