📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3165
ClientLeft = 60
ClientTop = 375
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3165
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "Command2"
Height = 495
Left = 1920
TabIndex = 3
Top = 1800
Width = 1215
End
Begin VB.TextBox Text2
Height = 615
Left = 2280
TabIndex = 2
Text = "Text2"
Top = 480
Width = 2295
End
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 495
Left = 240
TabIndex = 1
Top = 1800
Width = 1215
End
Begin VB.TextBox Text1
Height = 615
Left = 120
TabIndex = 0
Text = "Text1"
Top = 480
Width = 2055
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Function dfs(jd#) As Double
Dim d, f, s1, h, x As Double
d = Int(jd)
x = (jd - d) * 100
f = Int(x)
s1 = (x - f) * 100
h = (d * 3600 + f * 60 + s1) / 206265
dfs = h
End Function
Private Sub Command1_Click()
Dim a As Double
a = dfs(Text1.Text)
Text1.Text = a
End Sub
Private Function hdzh(hd$) As String
Dim d, f, s0, h, x As Double
Dim x1$, x2#
x2 = Val(hd)
x = x2 * 206265
d = Int(x / 3600)
f = Int((x / 3600 - d) * 60)
s0 = ((x / 3600 - d) * 60 - f) * 60
x1 = Str$(d) & "," & Str$(f) & "," & Str$(s0)
hdzh = x1
End Function
Private Sub Command2_Click()
Dim a As String
a = hdzh(Text2.Text)
Text2.Text = a
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -