📄 form05.frm
字号:
VERSION 5.00
Object = "{9BD6A640-CE75-11D1-AF04-204C4F4F5020}#2.0#0"; "mo20.ocx"
Begin VB.Form Form05
Caption = "墨西哥地图"
ClientHeight = 6360
ClientLeft = 60
ClientTop = 345
ClientWidth = 8400
LinkTopic = "Form1"
ScaleHeight = 6360
ScaleWidth = 8400
StartUpPosition = 3 '窗口缺省
Begin VB.OptionButton Option3
Caption = "多边形"
Height = 495
Left = 5160
TabIndex = 3
Top = 5760
Width = 1215
End
Begin VB.OptionButton Option2
Caption = "圆"
Height = 495
Left = 3480
TabIndex = 2
Top = 5760
Width = 1215
End
Begin VB.OptionButton Option1
Caption = "矩形"
Height = 495
Left = 1920
TabIndex = 1
Top = 5760
Value = -1 'True
Width = 1215
End
Begin MapObjects2.Map Map1
Height = 5655
Left = 0
TabIndex = 0
Top = 0
Width = 8415
_Version = 131072
_ExtentX = 14843
_ExtentY = 9975
_StockProps = 225
BackColor = 16777215
BorderStyle = 1
Contents = "form05.frx":0000
End
End
Attribute VB_Name = "Form05"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Xuewei,2003/5/7
'用AddEvent方法画矩形、圆形和多边形;
Option Explicit
Dim Shp As Object
Private Function trackShape() As Object
Dim poly As New MapObjects2.Polygon
Dim evPoly As New MapObjects2.GeoEvent
Set poly = Map1.TrackPolygon
Set trackShape = poly
Set evPoly = Map1.TrackingLayer.AddEvent(poly, 0)
With Map1.TrackingLayer.Symbol(0)
.SymbolType = moFillSymbol
.Style = moGrayFill
.Color = moRed
.OutlineColor = moRed
End With
End Function
Private Function trackShape1() As Object
Dim poly As New MapObjects2.Rectangle
Dim evPoly As New MapObjects2.GeoEvent
Set poly = Map1.TrackRectangle
Set trackShape1 = poly
Set evPoly = Map1.TrackingLayer.AddEvent(poly, 0)
With Map1.TrackingLayer.Symbol(0)
.SymbolType = moFillSymbol
.Style = moGrayFill
.Color = moBlue
.OutlineColor = moBlue
End With
End Function
Private Function trackShape2() As Object
Dim poly As New MapObjects2.Ellipse
Dim evPoly As New MapObjects2.GeoEvent
Set poly = Map1.TrackCircle
Set trackShape2 = poly
Set evPoly = Map1.TrackingLayer.AddEvent(poly, 0)
With Map1.TrackingLayer.Symbol(0)
.SymbolType = moFillSymbol
.Style = moGrayFill
.Color = moGreen
.OutlineColor = moGreen
End With
End Function
Private Sub Map1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Option1 Then
Set Shp = trackShape1
ElseIf Option2 Then
Set Shp = trackShape2
Else
Set Shp = trackShape
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -