Brushes.Black : Brush « 2D Graphics « C# / C Sharp






Brushes.Black

 

using System;
using System.Drawing;
using System.Windows.Forms;
   
class HelloWorld: Form
{
     public static void Main()
     {
          Application.Run(new HelloWorld());
     }
     public HelloWorld()
     {
          Text = "Hello World";
          BackColor = Color.White;
     }
     protected override void OnPaint(PaintEventArgs pea)
     {
          Graphics graphics = pea.Graphics;
   
          graphics.DrawString("Hello, Windows Forms!", Font, 
                          Brushes.Black, 0, 0);
     }
}

 








Related examples in the same category

1.Solid brush demoSolid brush demo
2.Use Brushes.BlueViolet ro draw a PolygonUse Brushes.BlueViolet ro draw a Polygon
3.Use Brushes.Aquamarine to draw a EllipseUse Brushes.Aquamarine to draw a Ellipse
4.Use Brush to draw a RectangleUse Brush to draw a Rectangle
5.Gradient brush demoGradient brush demo
6.illustrates filling shapes with a brushillustrates filling shapes with a brush
7.Brush StyleBrush Style
8.Hatch Brush StylesHatch Brush Styles
9.Hexagon Gradient Brush