入数字,当单击命令按钮时,在标签框中显示输入的数字为奇数或者偶数。设计这个程序。?
æè¦æ±å¨çªä½ä¸æ·»å ä¸ä¸ªæ ç¾åä¸ä¸ªææ¬æ¡ä»¥åä¸ä¸ªå½ä»¤æé®ï¼åå»å½ä»¤æé®ï¼å é¤ææ代ç ï¼å¤å¶å¦ä¸ä»£ç å°ç¨åºä¸
Private Sub Command1_Click()
If Val(Text1) Mod 2 = 0 Then
Label1 = "å¶æ°"
Else
Label1 = "å¥æ°"
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer) 'å¤å符
If KeyAscii < 48 Or KeyAscii > 57 Then KeyAscii = 0 '0-9å符ä¹å¤å±è½
End Sub
è¥æ»¡æ请åæ¶é纳ï¼è°¢è°¢
Private Sub Command1_Click()
If Val(Text1) Mod 2 = 0 Then
Label1 = "å¶æ°"
Else
Label1 = "å¥æ°"
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer) 'å¤å符
If KeyAscii < 48 Or KeyAscii > 57 Then KeyAscii = 0 '0-9å符ä¹å¤å±è½
End Sub
è¥æ»¡æ请åæ¶é纳ï¼è°¢è°¢
温馨提示:答案为网友推荐,仅供参考