⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 在VB中利用MO组件在图层中画线 for MO
💻 FRM
字号:
VERSION 5.00
Object = "{9BD6A640-CE75-11D1-AF04-204C4F4F5020}#2.0#0"; "Mo20.ocx"
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   6885
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   8025
   LinkTopic       =   "Form1"
   ScaleHeight     =   6885
   ScaleWidth      =   8025
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "画线"
      Height          =   495
      Left            =   3360
      TabIndex        =   0
      Top             =   5760
      Width           =   1335
   End
   Begin MapObjects2.Map Map1 
      Height          =   5175
      Left            =   480
      TabIndex        =   1
      Top             =   240
      Width           =   6855
      _Version        =   131072
      _ExtentX        =   12091
      _ExtentY        =   9128
      _StockProps     =   225
      BackColor       =   16777215
      BorderStyle     =   1
      Contents        =   "Form1.frx":0000
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim g_Line As MapObjects2.Line
Dim Pts As MapObjects2.Points

Private Sub Command1_Click()
  Dim p As Point
  Set g_Line = New MapObjects2.Line
  Set Pts = New MapObjects2.Points
  Set p = Map1.ToMapPoint(100, 100)
  Pts.Add p
  Set p = Map1.ToMapPoint(3500, 1500)
  Pts.Add p
  g_Line.Parts.Add Pts
  Set Pts = g_Line.Parts(0)
  Map1.Refresh
End Sub

Private Sub Map1_AfterTrackingLayerDraw(ByVal hDC As stdole.OLE_HANDLE)
  If Not g_Line Is Nothing Then
    If Pts.Count > 1 Then
      Dim sym As New Symbol
      sym.Color = moRed
      sym.SymbolType = moLineSymbol
      sym.Size = 5
      Map1.DrawShape g_Line, sym
    End If
  End If
End Sub





⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -