📄 form2.frm
字号:
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 9
Left = 4080
TabIndex = 9
Top = 2880
Width = 615
End
Begin VB.CommandButton Command1
Caption = "8"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 8
Left = 3360
TabIndex = 8
Top = 2880
Width = 615
End
Begin VB.CommandButton Command1
Caption = "7"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 7
Left = 2640
TabIndex = 7
Top = 2880
Width = 615
End
Begin VB.CommandButton Command1
Caption = "6"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 6
Left = 4080
TabIndex = 6
Top = 2280
Width = 615
End
Begin VB.CommandButton Command1
Caption = "5"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 5
Left = 3360
TabIndex = 5
Top = 2280
Width = 615
End
Begin VB.CommandButton Command1
Caption = "4"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 4
Left = 2640
TabIndex = 4
Top = 2280
Width = 615
End
Begin VB.CommandButton Command1
Caption = "3"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 3
Left = 4080
TabIndex = 3
Top = 1680
Width = 615
End
Begin VB.CommandButton Command1
Caption = "2"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 2
Left = 3360
TabIndex = 2
Top = 1680
Width = 615
End
Begin VB.CommandButton Command1
Caption = "1"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 1
Left = 2640
TabIndex = 1
Top = 1680
Width = 615
End
Begin VB.CommandButton Command1
Caption = "0"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 0
Left = 2640
TabIndex = 0
Top = 3480
Width = 615
End
Begin VB.Timer Timer1
Interval = 1000
Left = 2520
Top = 3120
End
Begin VB.TextBox Text6
BeginProperty Font
Name = "新宋体"
Size = 14.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 5760
TabIndex = 56
Top = 3480
Width = 1335
End
Begin VB.TextBox Text3
Height = 435
Left = 2400
TabIndex = 46
Text = "Text3"
Top = 3120
Visible = 0 'False
Width = 1935
End
Begin VB.TextBox Text4
Height = 495
Left = 4680
TabIndex = 47
Text = "Text4"
Top = 2520
Visible = 0 'False
Width = 1215
End
Begin VB.TextBox Text2
Height = 735
Left = 3120
TabIndex = 45
Text = "Text2"
Top = 1800
Visible = 0 'False
Width = 2535
End
Begin VB.Label Label1
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1560
TabIndex = 29
Top = 1080
Width = 735
End
Begin VB.Menu 编辑
Caption = "编辑(&E)"
Begin VB.Menu 复制
Caption = "复制(&C)"
Shortcut = ^C
End
Begin VB.Menu 粘贴
Caption = "粘贴(&P)"
Shortcut = ^V
End
End
Begin VB.Menu 查看
Caption = "查看(&V)"
Begin VB.Menu 标准型
Caption = "标准型(&T)"
End
Begin VB.Menu 科学型
Caption = "科学型(&S)"
End
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim a, b As Single
Dim n As Single
Dim flag, flag1 As Boolean
Dim m, x As Single
Dim FLAG2, flag3 As Boolean
Dim js As Boolean
Function jinzhi(h As String) As Double
Dim s, j As Double
Dim k, n, i As Single
Dim w As String
n = Len(h)
For i = 1 To n
w = Mid(h, i, 1)
If Val(w) <> 0 Then
j = Val(w) * 16 ^ (n - i)
Else
If w = "A" Then
j = 10 * 16 ^ (n - i)
ElseIf w = "B" Then
j = 11 * 16 ^ (n - i)
ElseIf w = "C" Then
j = 12 * 16 ^ (n - i)
ElseIf w = "D" Then
j = 13 * 16 ^ (n - i)
ElseIf w = "E" Then
j = 14 * 16 ^ (n - i)
ElseIf w = "F" Then
j = 15 * 16 ^ (n - i)
Else
j = 0
End If
End If
s = s + j
Next i
jinzhi = s
End Function
Function jc(g As Long) As Double
Dim s, n, i As Double
s = 1: n = 1
For i = 1 To g
s = s * n
n = n + 1
Next i
jc = s
End Function
Private Sub Command1_Click(Index As Integer)
If a = 2 Then
If Text1.Text <> "0." And flag3 = True Then
Select Case Index
Case 0 To 9
If Right(Text1.Text, 1) <> "." Or flag = False Then
Text1.Text = Text1.Text & Command1(Index).Caption
Else
Text1.Text = Left(Text1.Text, Len(Text1.Text) - 1) & Command1(Index).Caption & "."
End If
flag = True
Case 11
flag = False
Case 10
If Left(Text1.Text, 1) <> "-" Then
Text1.Text = "-" & Text1.Text
Else
Text1.Text = Right(Text1.Text, Len(Text1.Text) - 1)
End If
End Select
Else
If Index = 11 Then
flag = False
ElseIf Index = 10 Then
flag = True
If Left(Text1.Text, 1) <> "-" Then
Text1.Text = "-" & Text1.Text
Else
Text1.Text = Right(Text1.Text, Len(Text1.Text) - 1)
End If
Else
If flag = True Then
Text1.Text = Command1(Index).Caption & "."
Else
Text1.Text = Text1.Text & Command1(Index).Caption
End If
flag = True
End If
End If
Else
If Text1.Text <> "0" And flag3 = True Then
Text1.Text = Text1.Text & Command1(Index).Caption
Else
Text1.Text = Command1(Index).Caption
End If
End If
flag3 = True
FLAG2 = False
Text4.Text = Val(Text1.Text)
End Sub
Private Sub Command4_Click(Index As Integer)
flag3 = False
Select Case Index
Case 0
Label1.Caption = " "
Text2.Text = "0" & "."
Case 1
Text1.Text = Text2.Text
Case 2
Text2.Text = Text1.Text
Label1.Caption = " M"
Case 3
Label1.Caption = " M"
If a = 1 Then
Text2.Text = jinzhi(Text2.Text) + jinzhi(Text1.Text)
Text2.Text = Hex(Val(Text2.Text))
Else
If FLAG2 = False Then
Text2.Text = Val(Text2.Text) + Val(Text1.Text)
Else
flag1 = False
End If
End If
If Fix(Val(Text2.Text)) = Val(Text2.Text) And a = 2 Then
Text2.Text = Text2.Text & "."
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -