关于 excel VBA 的计算器问题
dimtextresasdoubledimpointtasstringPrivateSubUserForm_Initialize()textbox1.Text=0text...
dim textres as double
dim pointt as string
Private Sub UserForm_Initialize()
textbox1.Text = 0
textres = 0
pointt = ""
End Sub
Private Sub 零_Click()
If textbox1.Text = 0 Then
textres = 0
Else
If textbox1.Text = (0 & ".") Then
textbox1.Text = textbox1.Text & 0
Else
textbox1.Text = textbox1.Text & 0
textres = textbox1.Text
End If
End If
End Sub
Private Sub 点_Click()
pointt = "."
textbox1.Text = textbox1.Text & "."
点.Enabled = False
End Sub
我这样操作:按零,再按点,此时是textbox1显示的是0.
但再按零的话,就还是0.
请哪位高手帮我找找哪出问题了 展开
dim pointt as string
Private Sub UserForm_Initialize()
textbox1.Text = 0
textres = 0
pointt = ""
End Sub
Private Sub 零_Click()
If textbox1.Text = 0 Then
textres = 0
Else
If textbox1.Text = (0 & ".") Then
textbox1.Text = textbox1.Text & 0
Else
textbox1.Text = textbox1.Text & 0
textres = textbox1.Text
End If
End If
End Sub
Private Sub 点_Click()
pointt = "."
textbox1.Text = textbox1.Text & "."
点.Enabled = False
End Sub
我这样操作:按零,再按点,此时是textbox1显示的是0.
但再按零的话,就还是0.
请哪位高手帮我找找哪出问题了 展开
2个回答
2012-04-11
展开全部
Private Sub 零_Click()
If textbox1.Text = "0" Then
textres = 0
Else
If textbox1.Text = "0." Then
textbox1.Text = textbox1.Text & "0"
Else
这样子改一下试试……
If textbox1.Text = "0" Then
textres = 0
Else
If textbox1.Text = "0." Then
textbox1.Text = textbox1.Text & "0"
Else
这样子改一下试试……
更多追问追答
追问
你的方法行不通
追答
那么最好把你的文件发来 看看你其他的代码……327391401
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询