A Note Page Effect to Windows Form using Graphics


A simple but effective graphics class for Windows

A simple graphics class to give note book or notepage effect to your window
form.


//Copy this code as it is.
protected override void OnPaint(PaintEventArgs e)
{
this.BackColor = Color.White;
for (int i = 0; i <= this.Height; i++)
{
e.Graphics.DrawLine(Pens.Black, 0, i, this.Width, i);
i = i + 20;
}
e.Graphics.DrawString("Welcome to My Note Page", new Font("Arial", 14), Brushes.Black,45,0);
e.Graphics.DrawString("This is a Graphics Class Example in C#", new Font("Arial", 14), Brushes.Blue, 45, 20);
e.Graphics.DrawString("I Have used 2 function", new Font("Arial", 14), Brushes.Green, 45, 42);
e.Graphics.DrawLine(Pens.Red,40,0,40,this.Height);
}


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: