Gambar diatas terdapat :
Label1
Label2
Text1
Command1
Command2
Kemudian masukan koding dibawah ini :
Private Sub command1_Click()
If Text1 = "" Then
MsgBox "Bilangan masih kosong"
Else
If Text1.Text Mod 2 = 0 Then
Label2.Caption = Text1.Text + " Bilangan Genap"
Else
Label2.Caption = Text1.Text + " Bilangan Ganjil"
End If
End If
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Label2.Caption = ""
Text1.Text = ""
End Sub
0 komentar:
Posting Komentar