Button.Click : Button « System.Windows.Forms « VB.Net by API






Button.Click

  

imports System
imports System.Drawing
imports System.Windows.Forms

public class EventsDemo : inherits System.Windows.Forms.Form

  Private btn as Button

  public sub New()
    btn = new Button()
    btn.Location = new Point(50,50)
    btn.Text = "Test"

    Controls.Add(btn)
        AddHandler btn.Click, AddressOf btn_Click
  end sub

  public shared sub Main() 
    Application.Run(new EventsDemo())
  end sub

  private sub btn_Click(ByVal sender as object,ByVal e as EventArgs)
    MessageBox.Show("btn_Click method","Events Demonstration")
  end sub
end class

       

   
    
  








Related examples in the same category

1.Button.Anchor
2.Button.BackColor
3.Button.FlatStyle
4.Button.HasChildren
5.Button.Image
6.Button.ImageAlign
7.Button.ImageIndex
8.Button.ImageList
9.Button.LostFocus
10.Button.MouseDown
11.Button.MouseEnter
12.Button.MouseHover
13.Button.MouseLeave
14.Button.MouseUp
15.Button.Paint
16.Button.Parent
17.Button.PerformClick
18.Button.Region
19.Button.Text
20.Button.TextAlign
21.Button.TopLevelControl
22.Button.UseVisualStyleBackColor