📄 form01.frm
字号:
VERSION 5.00
Object = "{9BD6A640-CE75-11D1-AF04-204C4F4F5020}#2.0#0"; "Mo20.ocx"
Begin VB.Form Form01
Caption = "标注偏移"
ClientHeight = 7215
ClientLeft = 60
ClientTop = 345
ClientWidth = 10035
LinkTopic = "Form1"
ScaleHeight = 7215
ScaleWidth = 10035
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton Command2
Caption = "有偏移"
Height = 495
Left = 5760
TabIndex = 2
Top = 6600
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "没有偏移"
Height = 495
Left = 2880
TabIndex = 1
Top = 6600
Width = 1215
End
Begin MapObjects2.Map Map1
Height = 6495
Left = 0
TabIndex = 0
Top = 0
Width = 9975
_Version = 131072
_ExtentX = 17595
_ExtentY = 11456
_StockProps = 225
BackColor = 16777215
BorderStyle = 1
Contents = "Form01.frx":0000
End
End
Attribute VB_Name = "Form01"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Xue Wei,2003/5/2
'属性的标注和标注字体的设置
Option Explicit
Dim Dbl As Boolean
Private Sub Command1_Click()
Dbl = False
Map1.Layers.Clear
DrawLayer
End Sub
Private Sub Command2_Click()
Dbl = True
Map1.Layers.Clear
DrawLayer
End Sub
Private Sub DrawLayer()
Dim dc As New DataConnection
Dim layer As MapLayer
dc.Database = App.Path + "\..\" + "Mexico"
If Not dc.Connect Then
MsgBox "在指定的文件夹下没找到图层数据文件!"
End
End If
Set layer = New MapLayer
Set layer.GeoDataset = dc.FindGeoDataset("States")
layer.Symbol.Color = moOrange
layer.Symbol.Size = 1
layer.Symbol.Style = 2
layer.Symbol.OutlineColor = moBrown
Map1.Layers.Add layer
Set layer = New MapLayer
Set layer.GeoDataset = dc.FindGeoDataset("Cities")
layer.Symbol.Color = moRed
layer.Symbol.Size = 3
layer.Symbol.Style = 0
Set layer.Renderer = New LabelRenderer
With layer.Renderer
If Dbl Then
.XOffsetField = "CITIES_"
End If
.Field = "NAME"
.Symbol(0).Color = moBlack
.Symbol(0).Font.Size = 8
End With
Map1.Layers.Add layer
Map1.Refresh
End Sub
Private Sub Form_Load()
Dbl = False
DrawLayer
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -