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

📄 form08.frm

📁 给出了详细的vb环境下mo基本功能的代码 如图层的加载
💻 FRM
字号:
VERSION 5.00
Object = "{9BD6A640-CE75-11D1-AF04-204C4F4F5020}#2.0#0"; "mo20.ocx"
Begin VB.Form Form08 
   Caption         =   "画椭圆"
   ClientHeight    =   4530
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6390
   LinkTopic       =   "Form1"
   ScaleHeight     =   4530
   ScaleWidth      =   6390
   StartUpPosition =   2  '屏幕中心
   Begin MapObjects2.Map Map1 
      Height          =   4455
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   6375
      _Version        =   131072
      _ExtentX        =   11245
      _ExtentY        =   7858
      _StockProps     =   225
      BackColor       =   16777215
      BorderStyle     =   1
      Contents        =   "form08.frx":0000
   End
End
Attribute VB_Name = "Form08"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Xuewei,2003/5/9
'在图上画椭圆

Option Explicit

Dim el As New MapObjects2.Ellipse

Private Sub Map1_AfterTrackingLayerDraw(ByVal hDC As stdole.OLE_HANDLE)
  If Not el Is Nothing Then
    Dim sym As New MapObjects2.Symbol
    sym.SymbolType = moFillSymbol
    sym.Style = moLightGrayFill
    sym.Size = 1
    sym.Color = moRed
    Map1.DrawShape el, sym
  End If
End Sub

Private Sub Map1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  Dim Dist As Double
  Dim Pt As New MapObjects2.Point
  
  Dist = 0.1
  Set Pt = Map1.ToMapPoint(X, Y)
  el.Right = Pt.X + 2 * Dist
  el.Left = Pt.X - Dist
  el.Top = Pt.Y + Dist
  el.Bottom = Pt.Y - Dist
  
  Map1.Refresh
End Sub



  

⌨️ 快捷键说明

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