Button.Text : Button « System.Windows.Forms « C# / C Sharp by API






Button.Text

   
                  





using System;
using System.Drawing;
using System.Windows.Forms;
   
public class MainForm : Form
{
    public static void Main()
    {
        MainForm MyForm = new MainForm();
   
        Application.Run(MyForm);
    }
   
    public MainForm()
    {
        Button MyButton = new Button();
        
        Text = "Button Test";
        MyButton.Location = new Point(25, 25);
        MyButton.Text = "Click Me";
        MyButton.Click += new EventHandler(MyButtonClicked);
        Controls.Add(MyButton);
    }
    
    public void MyButtonClicked(object sender, EventArgs Arguments)
    {
        MessageBox.Show("The button has been clicked.");
    }
}

   
    
    
  








Related examples in the same category

1.new Button()
2.Button.Anchor
3.Button.Click
4.Button.DialogResult
5.Button.Dock
6.Button.FlatStyle
7.Button.Font
8.Button.Image
9.Button.Location
10.Button.MouseDown
11.Button.MouseEnter
12.Button.Parent
13.Button.PerformClick()
14.Button.Size
15.Button.TextAlign
16.Button.Top