Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Sub Form13_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- Dim point As Integer
- Dim point1 As Integer
- point = 20
- point1 = 100
- counter = 0
- Label2.Text = Form12.selected_value
- Dim connection As New MySqlConnection
- connection.ConnectionString = ("host=localhost;user=root;password=;database=pos;")
- connection.Open()
- Dim command As New MySqlCommand("select * from categories", connection)
- Dim reader As MySqlDataReader
- reader = command.ExecuteReader
- While reader.Read()
- Dim button As New Button
- value = reader.GetString("category_name")
- button.Name = value
- button.Text = value
- button.Height = 50
- button.Width = 190
- button.Font = New Font("arial", 11)
- button.Location = New Point(point, point1)
- Me.Controls.Add(button)
- point1 = point1 + 50
- counter = counter + 1
- verifier(0) = counter
- arr(counter) = value
- AddHandler button.Click, AddressOf button_Click
- button_Click()
- End While
- End Sub
- Private Sub button_Click()
- MsgBox(arr(counter))
- End Sub
Add Comment
Please, Sign In to add comment