我这里只有代码. C++的代码
你自己用C#编辑一下吧!
代码:
Option Explicit
Dim index1 As Integer, b As Single, a As Single, index2 As Integer, c As Integer
Dim index3 As Integer
Private Sub Command1_Click(Index As Integer)
Dim ab As Integer
For index1 = 0 To 9
If Index = index1 Then
Text1.SelText = index1
b = Val(Text1.Text)
End If
Next index1
For index2 = 11 To 14
If Index = index2 Then
c = index2
a = b
b = 0
Text1.Text = ""
End If
Next index2
For index3 = 16 To 21
If Index = index3 Then
Text1.SelText = Hex(index3 - 6)
b = Val("&h" & Text1.Text)
End If
Next index3
If Index = 10 Then
If InStr(1, Text1.Text, ".") = 0 Then
Text1.SelText = "."
b = Val(Text1.Text)
Else
Exit Sub
End If
End If
If Index = 15 Then
kk c
End If
If Index = 22 Then
Text1.SelStart = 0
Text1.SelText = "-"
Text1.SelStart = Len(Text1)
b = Val(Text1.Text)
End If
End Sub
Sub kk(c As Integer)
If c = 11 Then
If b = 0 Then
MsgBox "除数不为0", 16, "错误"
Else
Text1.Text = Hex(a / b)
End If
ElseIf c = 12 Then
Text1.Text = Hex(a * b)
ElseIf c = 13 Then
Text1.Text = Hex(a - b)
ElseIf c = 14 Then
Text1.Text = Hex(a + b)
End If
a = 0
End Sub
楼主留言:
net是什么? 能不能说的详细点吗? 谢谢
[ 此帖被髒礼_在2009-09-03 19:41重新编辑 ]