Add a Button : Button : GUI Windows Form C# Source Code


Custom Search

C# Source Code » GUI Windows Form » Button »

 

Add a Button









    

/*
C#: The Complete Reference 
by Herbert Schildt 

Publisher: Osborne/McGraw-Hill (March 8, 2002)
ISBN: 0072134852
*/
// Add a Button. 
 
using System; 
using System.Windows.Forms; 
using System.Drawing; 
 
public 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# Source Code

 Navioo GUI Windows Form
» Button