01.
Public
Class
Form1
02.
03.
Private
Sub
Form1_Load(sender
As
Object
, e
As
EventArgs)
Handles
MyBase
.Load
04.
05.
Me
.BindingSource1.DataSource = GetTableForm(
"SELECT * FROM Sett_Post_Province"
)
06.
ProvinceTextBox.DataBindings.Add(
New
System.Windows.Forms.Binding(
"Text"
,
Me
.BindingSource1,
"Province"
,
True
))
07.
PvnIDTextBox.DataBindings.Add(
New
System.Windows.Forms.Binding(
"Text"
,
Me
.BindingSource1,
"pvnID"
,
True
))
08.
SymbolTextBox.DataBindings.Add(
New
System.Windows.Forms.Binding(
"Text"
,
Me
.BindingSource1,
"Symbol"
,
True
))
09.
End
Sub
10.
Private
Sub
Button1_Click(sender
As
Object
, e
As
EventArgs)
Handles
Button1.Click
11.
Dim
f
As
New
Form2
12.
f.ShowDialog()
13.
If
(f.PvItem <> 0)
Then
14.
Me
.BindingSource1.Filter =
"PvnID = "
& f.PvItem
15.
End
If
16.
End
Sub
17.
18.
Private
Sub
Button2_Click(sender
As
Object
, e
As
EventArgs)
Handles
Button2.Click
19.
Dim
f
As
New
Form2
20.
f.ShowDialog()
21.
For
i
As
Integer
= 0
To
f.DataGridView1.RowCount - 1
22.
If
Convert.ToBoolean(f.DataGridView1(0, i).Value) =
True
Then
23.
DataGridView1.Rows.Add(f.DataGridView1(1, i).Value, f.DataGridView1(2, i).Value, f.DataGridView1(3, i).Value)
24.
End
If
25.
Next
26.
End
Sub
27.
End
Class