Use the color of Window and WindowText from SystemColors : SystemColors : Graphics C# Source Code


Custom Search

C# Source Code » Graphics » SystemColors »

 

Use the color of Window and WindowText from SystemColors








    

using System;
using System.Drawing;
using System.Windows.Forms;
   
class HuckleberryFinn: Form
{
     public static void Main() 
     {
          Application.Run(new HuckleberryFinn()); 
     }
     public HuckleberryFinn()
     {
          Text = "\"The Adventures of Huckleberry Finn\"";
          BackColor = SystemColors.Window;
          ForeColor = SystemColors.WindowText;
          ResizeRedraw = true;
     }
     protected override void OnPaint(PaintEventArgs pea)
     {
          pea.Graphics.DrawString("some stretchers, as I said before.", Font, new SolidBrush(ForeColor), ClientRectangle);
     }
}
           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Graphics
» SystemColors