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

📄 form06.frm

📁 给出了详细的vb环境下mo基本功能的代码 如图层的加载
💻 FRM
字号:
VERSION 5.00
Object = "{9BD6A640-CE75-11D1-AF04-204C4F4F5020}#2.0#0"; "mo20.ocx"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form Form06 
   Caption         =   "墨西哥地图浏览系统"
   ClientHeight    =   5895
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   7845
   LinkTopic       =   "Form1"
   ScaleHeight     =   5895
   ScaleWidth      =   7845
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command3 
      Caption         =   "帮助"
      Height          =   375
      Left            =   4680
      TabIndex        =   1
      Top             =   5400
      Width           =   975
   End
   Begin VB.CommandButton Command1 
      Caption         =   "退出"
      Height          =   375
      Left            =   1920
      TabIndex        =   0
      Top             =   5400
      Width           =   975
   End
   Begin MSComctlLib.Toolbar Toolbar1 
      Align           =   1  'Align Top
      Height          =   480
      Left            =   0
      TabIndex        =   2
      Top             =   0
      Width           =   7845
      _ExtentX        =   13838
      _ExtentY        =   847
      ButtonWidth     =   714
      ButtonHeight    =   688
      Appearance      =   1
      ImageList       =   "ImageList1"
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
         NumButtons      =   4
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Object.ToolTipText     =   "放大"
            ImageIndex      =   1
            Style           =   2
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Object.ToolTipText     =   "缩小"
            ImageIndex      =   2
            Style           =   2
         EndProperty
         BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Object.ToolTipText     =   "移动"
            ImageIndex      =   3
            Style           =   2
         EndProperty
         BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Object.ToolTipText     =   "还原"
            ImageIndex      =   4
            Style           =   2
         EndProperty
      EndProperty
      OLEDropMode     =   1
   End
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   6720
      Top             =   5400
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   20
      ImageHeight     =   20
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   4
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Form06.frx":0000
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Form06.frx":0112
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Form06.frx":0224
            Key             =   ""
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Form06.frx":0336
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin MapObjects2.Map Map1 
      Height          =   5295
      Left            =   0
      TabIndex        =   3
      Top             =   0
      Width           =   7815
      _Version        =   131072
      _ExtentX        =   13785
      _ExtentY        =   9340
      _StockProps     =   225
      BackColor       =   16777215
      BorderStyle     =   1
      Contents        =   "Form06.frx":0448
   End
End
Attribute VB_Name = "Form06"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Xue Wei,2003/5/1
'选择工具栏,可以实现放大、缩小、移动和还原的功能;

Option Explicit
Dim r As MapObjects2.Rectangle

Private Sub Command1_Click()
  End
End Sub

Private Sub Command3_Click()
  Dim Bs As String
  Bs = "选择工具栏,可以实现放大、缩小、移动和还原的功能。" & vbCrLf & vbCrLf & "Xue Wei,2003/5/1"
  MsgBox Bs, , "墨西哥地图浏览系统帮助"
End Sub

Private Sub Map1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  If Toolbar1.Buttons(1).Value = 1 Then
    Set Map1.Extent = Map1.TrackRectangle
  ElseIf Toolbar1.Buttons(3).Value = 1 Then
    Map1.Pan
  ElseIf Toolbar1.Buttons(2).Value = 1 Then
    Set r = Map1.Extent
    r.ScaleRectangle 1.5
    Map1.Extent = r
  End If
End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
  If Toolbar1.Buttons(1).Value = 1 Then
    Map1.MousePointer = moZoomIn
  ElseIf Toolbar1.Buttons(3).Value = 1 Then
    Map1.MousePointer = moPan
  ElseIf Toolbar1.Buttons(2).Value = 1 Then
    Map1.MousePointer = moZoomOut
  ElseIf Toolbar1.Buttons(4).Value = 1 Then
    Set Map1.Extent = Map1.FullExtent
    Map1.MousePointer = moDefault
  End If
End Sub

⌨️ 快捷键说明

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