简单程序源代码

Private Sub Command1_Click()
a = Val(Text1.Text)
b = Val(Text2.Text)
t = b / (a * a)
If t <= 18 Then Text3.Text = "瘦!"
If t > 18 And t <= 25 Then Text3.Text = "正常"
If t >= 25 And t < 28 Then Text3.Text = "胖!"
If t > 28 Then Text3.Text = "肥胖!"
End Sub


Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End Sub



Private Sub Command1_Click()

Dim n As Long
Dim i As Long

n = Val(Text1.Text)
i = 0
Font.Size = 40
Print n;
Do
If n Mod 2 = 1 Then
n = n * 3 + 1
Else: n = n \ 2
End If
Print "-->"; n;
i = i + 1
If i Mod 5 = 0 Then Print
Loop Until (n <= 1)


End Sub


Private Sub Command1_Click()
Dim a As Single, b As Single, c As Single
a = Val(Right(Combo1.Text, 4))
b = Val(Text1.Text)
c = a * b
If Option1.Value = True Then c = c * 1.2
If Option2.Value = True Then c = c * 1.1
If Check1.Value = 1 Then c = c + 4000
If Check2.Value = 1 Then c = c + 6000
If Check3.Value = 1 Then c = c + 2000
Text2.Text = c




End Sub

Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""

End Sub

Private Sub Form_Load()
Combo1.AddItem "砖混结构 单价每平米4000"
Combo1.AddItem "钢混结构 单价每平米5000"
Combo1.AddItem "框架结构 单价每平米 6000"
Combo1.Text = "砖混结构 单价每平米4000"
Option3.Value = True


End Sub






相关文档
最新文档