-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfrmSelectTable.vb
More file actions
48 lines (39 loc) · 1.43 KB
/
Copy pathfrmSelectTable.vb
File metadata and controls
48 lines (39 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Imports MySql.Data.MySqlClient
Public Class frmSelectTable
Dim btnTable As New Button
Private Sub ToolStripButton2_Click(sender As Object, e As EventArgs) Handles ToolStripButton2.Click
Me.Dispose()
End Sub
Sub LoadTable()
cn.Open()
cm = New MySqlCommand("select * from tbltable", cn)
dr = cm.ExecuteReader
While dr.Read
btnTable = New Button
btnTable.Width = 95
btnTable.Height = 35
btnTable.Text = dr.Item("tableno").ToString
btnTable.FlatStyle = FlatStyle.Flat
btnTable.BackColor = Color.FromArgb(200, 100, 0)
btnTable.ForeColor = Color.White
btnTable.Cursor = Cursors.Hand
btnTable.TextAlign = ContentAlignment.MiddleLeft
TableFlowLayoutPanel.Controls.Add(btnTable)
'add handler for table no
AddHandler btnTable.Click, AddressOf GetTable_Click
'Filtering
'AddHandler btnTable.Click, AddressOf filter_click
End While
dr.Close()
cn.Close()
End Sub
Sub GetTable_Click(sender As Object, e As EventArgs)
Dim table As String = sender.text.ToString
With frmPOS
.lbltable.Text = table
End With
Me.Dispose()
End Sub
Private Sub TableFlowLayoutPanel_Paint(sender As Object, e As PaintEventArgs) Handles TableFlowLayoutPanel.Paint
End Sub
End Class