Solid brush demo : Brush : Graphics C# Source Code


Custom Search

C# Source Code » Graphics » Brush »

 

Solid brush demo









    

  using System;
  using System.Drawing;
  using System.Collections;
  using System.ComponentModel;
  using System.Windows.Forms;
  using System.Data;

  public class MainForm : System.Windows.Forms.Form
  {
    private System.ComponentModel.Container components;

    public MainForm()
    {
      InitializeComponent();
      BackColor = Color.LemonChiffon;  
      Text = "www.navioo.com";    
      Size = new Size(200, 200);    
      CenterToScreen();        
    }

    protected override void Dispose( bool disposing )
    {
      if( disposing )
      {
        if (components != null) 
        {
          components.Dispose();
        }
      }
      base.Dispose( disposing );
    }

    private void InitializeComponent()
    {
      this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
      this.ClientSize = new System.Drawing.Size(292, 273);
      this.Text = "Form1";
      this.Resize += new System.EventHandler(this.MainForm_Resize);
      this.Paint += new System.Windows.Forms.PaintEventHandler(this.MainForm_Paint);

    }
    [STAThread]
    static void Main() 
    {
      Application.Run(new MainForm());
    }

    private void MainForm_Resize(object sender, System.EventArgs e)
    {
      Invalidate();
    }

    private void MainForm_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
    {
      Graphics g = e.Graphics;
      g.DrawString("www.navioo.com", 
        new Font("Times New Roman", 20), 
        new SolidBrush(Color.Black), 
        this.DisplayRectangle);
    }
  }



           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Graphics
» Brush