Coding program mencari bilangan ganjil genap:
Private Sub Command1_Click()
If Text1.Text = "" Then
Label1.Caption = ""
ElseIf Val(Text1.Text) Mod 2 = 0 Then
Label1.Caption = "GENAP"
Else
Label1.Caption = "GANJIL"
End If
Command2.Enabled = True
Command1.Enabled = False
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Label1.Caption = ""
Command1.Enabled = True
Command2.Caption = False
Text1.SetFocus
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Command1.SetFocus
End If
End Sub
Tidak ada komentar:
Posting Komentar