男人也辛苦,英雄也会累。
Private Sub Command1_Click()
Text2.Text = Sqr(Val(Sum) / Val(i))
Text3.Text = Sqr(Val(Sum) / Val(2 * i))
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text1.SetFocus
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Form_Load()
Dim s As Single
Dim i As Single
Dim a As Integer
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
Me.Caption = Str(KeyAscii)
If IsNumeric(Text1.Text) And KeyAscii = 13 Then
s = 0
i = 1
Text4.Text = 0
Text4.Text = Val(Text4.Text) + i 'ÐмÆÊýÆ÷
a = Val(Text1.Text)
s = a * a + s
Text5.Text = s
Text6.Text = Text6.Text + Text1.Text 'ÏÔʾ¼üÈëµÄËùÓÐTEXT1µÄÊýÖµ
Text1.Text = ""
Text1.SetFocus
Else
Text1.Text = ""
Text1.SetFocus
End If
End Sub