计算器中按键的用法
来源:百度知道 编辑:UC知道 时间:2024/05/10 05:49:16
举例说明一下。不太懂
什么按键啊
我编了一个
把代码给你吧
Public p As String
Public f As Double
Public s As Double
Dim X
Dim a
Dim b
Dim c
Dim d
Private Sub cmdAbs_Click()
If txtScreen.Text = "" Then
MsgBox "无数字,无法计算"
ElseIf txtScreen.Text <> 0 Then
f = txtScreen.Text
s = f
s = Abs(s)
txtScreen.Text = s
txtScreen2.Text = s
End If
End Sub
Private Sub cmdAtn_Click()
If txtScreen.Text = "" Then
MsgBox "无数字,无法计算"
ElseIf txtScreen.Text <> "" Then
f = txtScreen.Text
s = f
s = Atn(s)
txtScreen.Text = s
txtScreen2