<pre lang="vb"> Dim ButArr As System.Windows.Forms.Button() = New Button(0) {} Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ButArr(0) = New Button ButArr(0).Height = 50 ButArr(0).Width = 100 ButArr(0).Top = 70 ButArr(0).Left = 200 ButArr(0).FlatStyle = FlatStyle.Flat ButArr(0).ForeColor = Color.WhiteSmoke ButArr(0).BackColor = Color.DarkViolet ButArr(0).Text = "Hello World" Controls.Add(ButArr(0)) End Sub
AddHandler ButArr(0).Click, AddressOf ClickHandler
Public Sub ClickHandler(ByVal sender As Object, ByVal e As _ System.EventArgs) MsgBox("Hello World") End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)