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

📄 form05.frm

📁 给出了详细的vb环境下mo基本功能的代码 如图层的加载
💻 FRM
字号:
VERSION 5.00
Object = "{9BD6A640-CE75-11D1-AF04-204C4F4F5020}#2.0#0"; "mo20.ocx"
Begin VB.Form Form05 
   Caption         =   "墨西哥地图浏览系统"
   ClientHeight    =   5295
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6540
   LinkTopic       =   "Form1"
   ScaleHeight     =   5295
   ScaleWidth      =   6540
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command3 
      Caption         =   "帮助"
      Height          =   375
      Left            =   4560
      TabIndex        =   2
      Top             =   4680
      Width           =   975
   End
   Begin VB.CommandButton Command2 
      Caption         =   "还原"
      Height          =   375
      Left            =   2760
      TabIndex        =   1
      Top             =   4680
      Width           =   975
   End
   Begin VB.CommandButton Command1 
      Caption         =   "缩小"
      Height          =   375
      Left            =   960
      TabIndex        =   0
      Top             =   4680
      Width           =   975
   End
   Begin MapObjects2.Map Map1 
      Height          =   4215
      Left            =   360
      TabIndex        =   3
      Top             =   240
      Width           =   5775
      _Version        =   131072
      _ExtentX        =   10186
      _ExtentY        =   7435
      _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
'Xue Wei,2003/4/30
'简单的墨西哥地图浏览系统
'实现按右键移动、左键放大;
'按“缩小”按钮缩小地图50%;
'按“还原”按钮还原地图原始尺寸。
'还有一个简单的帮助

Option Explicit

Private Sub Command1_Click()
  Dim p As MapObjects2.Point
  Dim recs As MapObjects2.Recordset
  Dim r As MapObjects2.Rectangle
  Set r = Map1.Extent
  r.ScaleRectangle 1.5
  Map1.Extent = r
End Sub

Private Sub Command2_Click()
  Set Map1.Extent = Map1.FullExtent
End Sub

Private Sub Command3_Click()
  Dim Bs As String
  Bs = "按右键移动,左键放大;" & vbCrLf & "按“缩小”按钮缩小地图50%;" & vbCrLf & _
   "按“还原”按钮还原地图原始尺寸。" & vbCrLf & vbCrLf & "Xue Wei,2003/4/30"
  MsgBox Bs, , "墨西哥地图浏览系统帮助"
End Sub

Private Sub Map1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  If Button = vbLeftButton Then
    Set Map1.Extent = Map1.TrackRectangle
  ElseIf Button = vbRightButton Then
    Map1.Pan
  End If
End Sub

⌨️ 快捷键说明

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