Vb .Net Dynamic Array Program
Public Class Form1
Dim ar As New ArrayList, a As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
a = 0
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ComboBox1.Items.Add(TextBox1.Text)
a = a + 1
ar.Add(a)
TextBox1.Text = ""
TextBox1.Focus()
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Label1.Text = ar.Item(ComboBox1.SelectedIndex).ToString
End Sub
End Class
No comments:
Post a Comment