Add a Button : Button : GUI Windows Forms C# Examples


C# Examples » GUI Windows Forms » Button »

 

Add a Button









    
using  System;  
using  System.Windows.Forms;  
using  System.Drawing;  
  
class  ButtonForm  :  Form  {  
    Button  MyButton  =  new  Button();  
  
    public  ButtonForm()  {  
        Text  =  "Using  a  Button";  
  
        MyButton  =  new  Button();  
        MyButton.Text  =  "Press  Here";  
        MyButton.Location  =  new  Point(100,  200);  
  
        Controls.Add(MyButton);  
    }      
  
    [STAThread]  
    public  static  void  Main()  {  
        ButtonForm  skel  =  new  ButtonForm();  
  
        Application.Run(skel);  
    }  
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo GUI Windows Forms
» Button