Untuk tampilan yang ga bisa di klik :
TxtKdMtUji.Enabled = False
LblMataUji.Enabled = False
TxtKdWaktu.Enabled = False
LabelWaktu.Enabled = False
untuk Tombol Entry
TxtKdMtUji.Enabled = True
LblMataUji.Enabled = True
TxtKdWaktu.Enabled = True
LabelWaktu.Enabled = True
TxtKdMtUji.Focus()
Untuk Tombol Clear
TxtKdMtUji.Text = " "
LblMataUji.Text = " "
TxtKdWaktu.Text = " "
LabelWaktu.Text = " "
TxtKdMtUji.Focus()
If ada 4 kondisi :
1) If kondisi then statement
If e.KeyChar = Chr(13) Then
If UCase(TxtKdMtUji.Text) = "A" Then LblMataUji.Text = "Microsoft Word"
If UCase(TxtKdMtUji.Text) = "B" Then LblMataUji.Text = "Microsoft Excel"
End If
2) Cara 2 .....
If kondisi Then
Statement
Else
If kondisi Then
Statement
End If
------------------------
'If UCase(txtkodematauji.Text) = "A" Then
'lblkodewaktu.Text = "Microsoft Word"
'Else
'If UCase(txtkodematauji.Text) = "B" Then
'lblkodewaktu.Text = "Microsoft Excel"
'End If
3) cara 3 ....
'If UCase(txtkodematauji.Text) = "A" Then
'lblkodewaktu.Text = "Microsoft Word"
'ElseIf UCase(txtkodematauji.Text) = "B" Then
'lblkodewaktu.Text = "Microsoft Excel"
'End If
4) cara 4 select nilai ekripsi ...
Select UCase(txtkodematauji.Text)
Case "A"
lblkodewaktu.Text = "Microsoft Word"
Case "B"
lblkodewaktu.Text = "Microsoft Excel"
Case Else
lblkodewaktu.Text = "Kode Salah "
End Select
txtkodewaktu.Focus()
End If
Contoh Tambahan Cara 3 dan 4
3. If UCase(txtkodewaktu.Text) = "P" Then
lblwaktu.Text = "Pagi"
ElseIf UCase(txtkodewaktu.Text) = "S" Then
lblwaktu.Text = "Sore"
Else
lblwaktu.Text = "Kode Salah"
End If
4. Select Case UCase(txtkodewaktu.Text)
Case "P"
lblwaktu.Text = "Pagi"
Case "S"
lblwaktu.Text = "Sore"
Case Else
lblwaktu.Text = "Kode Salah"
End Select
End If
End Sub
Tampilan 1:
Jumat, 02 Maret 2012
Form Percabangan
Tampilan 2:
Langganan:
Posting Komentar (Atom)


0 komentar:
Posting Komentar
Tuliskan Komentar Disini..