📄 frmcoordinatechange.frm
字号:
VERSION 5.00
Begin VB.Form FrmCoordinateChange
BorderStyle = 3 'Fixed Dialog
Caption = "坐标换算"
ClientHeight = 3525
ClientLeft = 45
ClientTop = 330
ClientWidth = 2940
Icon = "FrmCoordinateChange.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3525
ScaleWidth = 2940
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton CmdExit
Caption = "退出"
Height = 375
Left = 1680
TabIndex = 15
Top = 3000
Width = 975
End
Begin VB.CommandButton CmdOk
Caption = "计算"
Height = 375
Left = 360
TabIndex = 14
Top = 3000
Width = 975
End
Begin VB.TextBox Text6
Height = 285
Left = 1800
TabIndex = 13
Top = 2400
Width = 975
End
Begin VB.TextBox Text5
Height = 285
Left = 1800
TabIndex = 12
Top = 2040
Width = 975
End
Begin VB.TextBox Text4
Height = 285
Left = 1800
TabIndex = 11
Text = "30"
Top = 1680
Width = 975
End
Begin VB.TextBox Text3
Height = 285
Left = 1800
TabIndex = 10
Text = "10"
Top = 1320
Width = 975
End
Begin VB.TextBox Text2
Height = 285
Left = 1800
TabIndex = 9
Text = "4"
Top = 960
Width = 975
End
Begin VB.TextBox Text1
Height = 285
Left = 1800
TabIndex = 8
Text = "5"
Top = 600
Width = 975
End
Begin VB.OptionButton Option2
Caption = "坐标反算"
Height = 255
Left = 1560
TabIndex = 1
Top = 240
Width = 1215
End
Begin VB.OptionButton Option1
Caption = "坐标正算"
Height = 255
Left = 240
TabIndex = 0
Top = 240
Width = 1095
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "终止点Y坐标(米)"
Height = 195
Index = 3
Left = 120
TabIndex = 7
Top = 2400
Width = 1275
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "终止点X坐标(米)"
Height = 195
Index = 2
Left = 120
TabIndex = 6
Top = 2040
Width = 1275
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "坐标方位角(度分秒)"
Height = 195
Left = 120
TabIndex = 5
Top = 1680
Width = 1530
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "两点间边长(米)"
Height = 195
Left = 120
TabIndex = 4
Top = 1320
Width = 1170
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "起始点Y坐标(米)"
Height = 195
Index = 1
Left = 120
TabIndex = 3
Top = 960
Width = 1275
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "起始点X坐标(米)"
Height = 195
Index = 0
Left = 120
TabIndex = 2
Top = 600
Width = 1275
End
End
Attribute VB_Name = "FrmCoordinateChange"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub CmdExit_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Dim dist As Double
Dim Azimuth As Double
Dim IFStartP As Boolean
Dim X1 As Double, Y1 As Double
Dim X2 As Double, Y2 As Double
If Option1.Value = True Then '坐标正算
If Text1.Text = "" And Text2.Text = "" And Text5.Text <> "" And Text6.Text <> "" Then '已知终止点,求起始点
IFStartP = False
X2 = Text5.Text
Y2 = Text6.Text
ElseIf Text1.Text <> "" And Text2.Text <> "" And Text5.Text = "" And Text6.Text = "" Then '已知起始点,求终止点
IFStartP = True
X1 = Text1.Text
Y1 = Text2.Text
Else
MsgBox "数据输入不正确,请重新输入!", vbCritical, "警告"
Exit Sub
End If
dist = Text3.Text
Azimuth = Text4.Text
CoordinatePositive dist, Azimuth, IFStartP, X1, Y1, X2, Y2
If IFStartP = True Then
Text5.Text = Format(X2, "#.###")
Text6.Text = Format(Y2, "#.###")
Else
Text1.Text = Format(X1, "#.###")
Text2.Text = Format(Y1, "#.###")
End If
Else '坐标反算
X1 = Text1.Text
Y1 = Text2.Text
X2 = Text5.Text
Y2 = Text6.Text
CoordinateNegative dist, Azimuth, X1, Y1, X2, Y2
Text3.Text = Format(dist, "#.###")
Text4.Text = Azimuth
End If
End Sub
Private Sub Option1_Click()
If Option1.Value = True Then
Text1.Text = ""
Text2.Text = ""
Text5.Text = ""
Text6.Text = ""
End If
End Sub
Private Sub Option2_Click()
If Option2.Value = True Then
Text3.Text = ""
Text4.Text = ""
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -