📄 form03.frm
字号:
VERSION 5.00
Object = "{9BD6A640-CE75-11D1-AF04-204C4F4F5020}#2.0#0"; "mo20.ocx"
Begin VB.Form Form03
Caption = "Factor演示"
ClientHeight = 3825
ClientLeft = 60
ClientTop = 345
ClientWidth = 3915
LinkTopic = "Form1"
ScaleHeight = 67.469
ScaleMode = 6 'Millimeter
ScaleWidth = 69.056
StartUpPosition = 2 '屏幕中心
Begin VB.ListBox List1
Height = 2940
Left = 720
TabIndex = 1
Top = 120
Width = 2535
End
Begin MapObjects2.Map Map1
Height = 495
Left = 0
TabIndex = 0
Top = 0
Visible = 0 'False
Width = 495
_Version = 131072
_ExtentX = 873
_ExtentY = 873
_StockProps = 225
BackColor = 16777215
BorderStyle = 1
Contents = "Form03.frx":0000
End
Begin VB.Label Label1
Caption = "Label1"
Height = 375
Left = 120
TabIndex = 2
Top = 3240
Width = 3615
End
End
Attribute VB_Name = "Form03"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Xue Wei,2003/6/1
'Factor 练习;
Option Explicit
Dim unitObjs As New MapObjects2.Strings
Private Sub Form_Load()
Dim i As Integer
Label1.Caption = "选择List中的单位。"
'得到所有Unit常数名的集合;
unitObjs.PopulateWithUnits
'给List1赋值;
For i = 0 To unitObjs.Count - 1
List1.AddItem unitObjs(i) 'theUnit.Name
Next i
End Sub
Private Function stripProjection(theProjection As String) As Double
Dim openB As Integer
openB = InStr(theProjection, "[")
stripProjection = CDbl(Left(Right(theProjection, Len(theProjection) - openB) _
, Len(theProjection) - openB - 1))
End Function
Private Sub List1_Click()
Dim Str1 As String
Dim theUnit As New MapObjects2.Unit
Str1 = List1.List(List1.ListIndex)
theUnit.Type = Int(stripProjection(Str1))
Label1.Caption = "1个" & Str1 & " = " & Format(theUnit.factor, "0.000") & "米。"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -