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

📄 userform1.frm

📁 这是一个非常全的VB+AO二次开发实例集
💻 FRM
字号:
VERSION 5.00
Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} UserForm1 
   Caption         =   "UserForm1"
   ClientHeight    =   5100
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   7530
   OleObjectBlob   =   "UserForm1.frx":0000
   StartUpPosition =   1  'CenterOwner
End
Attribute VB_Name = "UserForm1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Private Sub cmdAddMxd_Click()
'    Dim pVbproject As New VBProject
'    Set pVbproject = ThisDocument.VBProject
'    Dim pMxfilePath As String
'    pMxfilePath = pVbproject.FileName & "\..\" & "data\addLyrFile.mxd"
'    'Load a MxFile according the pMxfilePath
'    UserForm1.MapControl1.LoadMxFile pMxfilePath
'    'show in full extent
'    MapControl1.Extent = MapControl1.FullExtent
'End Sub
'
'Private Sub cmdClose_Click()
'    Unload Me
'    ILayer
'
'End Sub
'
Option Explicit

Private Sub cmdLoadDoc_Click()
  
  On Error GoTo ErrorHandler

  'Open a file dialog for selecting map documents
  CommonDialog1.DialogTitle = "Browse Map Document"
  CommonDialog1.Filter = "Map Documents (*.mxd, *.mxt, *.pmf)|*.mxd;*.mxt;*.pmf"
  CommonDialog1.ShowOpen
  
  'Exit if no map document is selected
  m_sFilePath = CommonDialog1.FileName
  If m_sFilePath = "" Then Exit Sub
  
  'Validate and load map document
  If PageLayoutControl1.CheckMxFile(m_sFilePath) Then
    PageLayoutControl1.LoadMxFile m_sFilePath
    txbPath.Text = m_sFilePath
    m_sFilePath = ""
  Else
    MsgBox m_sFilePath & " is not a valid ArcMap document"
  End If

  Exit Sub
ErrorHandler:
  Select Case Err.Number
    Case 1031 'A password is required
      frmPassword.Show
  End Select

End Sub
Private Sub PageLayoutControl1_OnAfterScreenDraw(ByVal hdc As Long)
  
  'Set mouse pointer
  PageLayoutControl1.MousePointer = esriPointerDefault

End Sub
Private Sub PageLayoutControl1_OnBeforeScreenDraw(ByVal hdc As Long)
  
  'Set mouse pointer
  PageLayoutControl1.MousePointer = esriPointerHourglass

End Sub



Private Sub cmdAddMxd_Click()

End Sub

⌨️ 快捷键说明

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