Use Inherited form in a separate Main class : Form : GUI Windows Forms C# Examples


C# Examples » GUI Windows Forms » Form »

 

Use Inherited form in a separate Main class









    
using  System;
using  System.Drawing;
using  System.Windows.Forms;
      
class  SeparateMain
{
          public  static  void  Main()
          {
                    Application.Run(new  AnotherHelloWorld());
          }
}
class  AnotherHelloWorld:  Form
{
          public  AnotherHelloWorld()
          {
                    Text  =  "Another  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);
          }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo GUI Windows Forms
» Form