userform1.frm

来自「这是一个非常全的VB+AO二次开发实例集」· FRM 代码 · 共 83 行

FRM
83
字号
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 + =
减小字号Ctrl + -
显示快捷键?