VB Visual Basic
Menampilkan data pada vb menamplkan table di dalam nya
Kita tinggal masukan nama phone number
lalu save ini otomatis sudah masuk ke data nya masukin nama sesuai yang
ita inginkan di sini saya cumin memasukan table hanya 25 colom
Dim nama(25) As String
Dim phone(25) As String
Dim idx As Integer
Private Sub Rifresh3_Click()
For i = 1 To 25
fgl Col = 0
fgl Row = i
fgl Text = i
fgl Col = 1
fgl Text = Name(i)
fgl Col = 2
fgl Text = phone(i)
Next
End Sub
Private Sub Command1_Click()
idx = idx + 1
nama(idx) =
Text1.Text
phone(idx) =
Text2.Text
MsgBox "Data
sudah disimpan"
End Sub
Private Sub Command2_Click()
Dim found As Boolean
For idx = 1 To 25
If Text3.Text =
nama(idx) Then
found = True
Exit For
End If
Next
If found Then
MsgBox ("Phone
number is : " + phone(idx))
Else
MsgBox "Data
tidak ditemukan"
End If
End Sub
Private Sub Command3_Click()
For i = 1 To 25
MSFlexGrid1.Col =
0
MSFlexGrid1.Row =
i
MSFlexGrid1.Text =
i
MSFlexGrid1.Col =
1
MSFlexGrid1.Text =
nama(i)
MSFlexGrid1.Col =
2
MSFlexGrid1.Text =
phone(i)
Next
End Sub
Private Sub Form_Load()
MSFlexGrid1.Col =
0
MSFlexGrid1.Row =
0
MSFlexGrid1.Text =
"No"
MSFlexGrid1.Col =
1
MSFlexGrid1.Row =
0
MSFlexGrid1.Text =
"Name"
MSFlexGrid1.Col =
2
MSFlexGrid1.Row =
0
MSFlexGrid1.Text =
"Phone"
idx = 0
End Sub
TERIMA KASIH
No comments
Post a Comment