danijel.drmic
Member
- Joined
- Jul 2, 2009
- Messages
- 10
- Programming Experience
- 5-10
For example, when I click on the btn(5) I would like the textbox1 says: "5"
Thx
Thx
VB.NET:
Public Class Form1
Dim btn(7) As Button
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
For i = 1 To 7
btn(i) = New System.Windows.Forms.Button
btn(i).Location = New Point(i * 35, 35)
btn(i).Width = 32
btn(i).Height = 32
btn(i).Text = i
AddHandler btn(i).Click, AddressOf Button1_Click
Me.Controls.Add(btn(i))
Next
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = Button1.Text
End Sub
End Class