高手进来帮我看看~!~~高分@~

来源:百度知道 编辑:UC知道 时间:2024/05/23 13:17:13
高手进来看看,最近刚学VB6.0.现在编了一个小计算机,可是出了点问题:
1.运算选择晕的加,减,乘,除本来是汉字的,可是一选就变成符号
2.一选运算选择,在2个文本框中间的加减乘除符号不会变,就是加号.
以下是源代码请高手看看:
Private Sub Option1_Click()
Option1.Caption = "+"
Text3.Text = ""
End Sub

Private Sub Option2_Click()
Option2.Caption = "-"
Text3.Text = ""
End Sub

Private Sub Option3_Click()
Option3.Caption = "*"
Text3.Text = ""
End Sub

Private Sub Option4_Click()
Option4.Caption = "/"
Text3.Text = ""
End Sub

Private Sub Command1_Click()
Dim Number1, Number2, Result As Single
Number1 = Val(Text1.Text)
Number2 = Val(Text2.Text)

If Option1.Value = True Then
Result = Number1 + Number2
End If
If Option2.Value = True Then
Result = Number1 - Number2
End If
If Option3.Value = True Then
Result = Number1 * Number2
End If
If O

如果你的两个文本框之间的运算符号是在label上的话:
Private Sub Option1_Click()
Option1.Caption = "加"
label1.caption="+" '这里加一句这个,以下同,不在注释
Text3.Text = ""
End Sub

Private Sub Option2_Click()
Option2.Caption = "减"
label1.caption="-"
Text3.Text = ""
End Sub

Private Sub Option3_Click()
Option3.Caption = "乘"
label1.caption="*"
Text3.Text = ""
End Sub

Private Sub Option4_Click()
Option4.Caption = "除"
label1.caption="÷"
Text3.Text = ""
End Sub

Private Sub Command1_Click()
Dim Number1, Number2, Result As Single
Number1 = Val(Text1.Text)
Number2 = Val(Text2.Text)

If Option1.Value = True Then
Result = Number1 + Number2
End If
If Option2.Value = True Then
Result = Number1 - Number2
End