| | | | | | | [文章信息] | | | 作者: | | | 时间: | 2005-02-21 | | 出处: | blog | | 责任编辑: | 方舟 | |
| [文章导读] | | | 素数判断与计算、输出题,并把计算与存盘部分补充完整 | |
| |
|
| | | |
|
|
|
|
|
十、分苹果题:
Option Explicit
Private Sub Command1_Click(Index As Integer)
If Index = 0 Then If Val(Label3(0).Caption) > 1 Then Command1(0).Enabled = True Label3(0).Caption = Label3(0).Caption - 1 Else If Val(Label3(0).Caption) = 1 Then Label3(0).Caption = Label3(0).Caption - 1 End If Command1(0).Enabled = False End If Else If Val(Label3(1).Caption) > 1 Then Command1(1).Enabled = True Label3(1).Caption = Label3(1).Caption - 1 Else If Val(Label3(1).Caption) = 1 Then Label3(1).Caption = Label3(1).Caption - 1 End If Command1(1).Enabled = False End If
End If If Val(Label3(0).Caption) > Val(Label3(1).Caption) Then picSmile(0).Visible = True picCry(0).Visible = False picCry(1).Visible = True picSmile(1).Visible = False Else If Val(Label3(0).Caption) < Val(Label3(1).Caption) Then picCry(0).Visible = True picSmile(0).Visible = False picSmile(1).Visible = True picCry(1).Visible = False Else picSmile(0).Visible = True picCry(0).Visible = False picSmile(1).Visible = True picCry(1).Visible = False End If End If
End Sub
Private Sub Command2_Click(Index As Integer)
If Index = 0 Then Label3(0).Caption = Label3(0).Caption + 1 Command1(0).Enabled = True Else: Label3(1).Caption = Label3(1).Caption + 1 Command1(1).Enabled = True End If
If Val(Label3(0).Caption) > Val(Label3(1).Caption) Then picSmile(0).Visible = True picCry(0).Visible = False picCry(1).Visible = True picSmile(1).Visible = False Else If Val(Label3(0).Caption) < Val(Label3(1).Caption) Then picCry(0).Visible = True picSmile(0).Visible = False picSmile(1).Visible = True picCry(1).Visible = False Else picSmile(0).Visible = True picCry(0).Visible = False picSmile(1).Visible = True picCry(1).Visible = False End If End If
End Sub
Private Sub Form_Load()
picSmile(0).Visible = True picSmile(1).Visible = True Command1(0).Enabled = False Command1(1).Enabled = False
End Sub |
|
|
|
|
|
|
|
|
|