www.pudn.com > mapxoracle.zip > entirelayer.frm


VERSION 5.00 
Begin VB.Form FrmEntireLayer  
   Caption         =   "EntireLayer" 
   ClientHeight    =   3030 
   ClientLeft      =   60 
   ClientTop       =   345 
   ClientWidth     =   4740 
   LinkTopic       =   "Form2" 
   ScaleHeight     =   3030 
   ScaleWidth      =   4740 
   StartUpPosition =   2  '屏幕中心 
   Begin VB.CommandButton Command2  
      Caption         =   "取消" 
      Height          =   375 
      Left            =   2280 
      TabIndex        =   2 
      Top             =   2280 
      Width           =   1335 
   End 
   Begin VB.CommandButton Command1  
      Caption         =   "确认" 
      Height          =   375 
      Left            =   960 
      TabIndex        =   1 
      Top             =   2280 
      Width           =   1215 
   End 
   Begin VB.ComboBox Combo1  
      Height          =   300 
      Left            =   840 
      TabIndex        =   0 
      Text            =   "Combo1" 
      Top             =   480 
      Width           =   3015 
   End 
   Begin VB.Label YminValue  
      AutoSize        =   -1  'True 
      Caption         =   "0" 
      Height          =   180 
      Left            =   1440 
      TabIndex        =   11 
      Top             =   1680 
      Width           =   90 
   End 
   Begin VB.Label Label6  
      AutoSize        =   -1  'True 
      Caption         =   "YMIN:" 
      Height          =   180 
      Left            =   840 
      TabIndex        =   10 
      Top             =   1680 
      Width           =   450 
   End 
   Begin VB.Label XminValue  
      AutoSize        =   -1  'True 
      Caption         =   "0" 
      Height          =   180 
      Left            =   1440 
      TabIndex        =   9 
      Top             =   1440 
      Width           =   90 
   End 
   Begin VB.Label Label3  
      AutoSize        =   -1  'True 
      Caption         =   "XMIN:" 
      Height          =   180 
      Left            =   840 
      TabIndex        =   8 
      Top             =   1440 
      Width           =   450 
   End 
   Begin VB.Label YmaxValue  
      AutoSize        =   -1  'True 
      Caption         =   "0" 
      Height          =   180 
      Left            =   1440 
      TabIndex        =   7 
      Top             =   1200 
      Width           =   90 
   End 
   Begin VB.Label YMAX  
      AutoSize        =   -1  'True 
      Caption         =   "YMAX:" 
      Height          =   180 
      Left            =   840 
      TabIndex        =   6 
      Top             =   1200 
      Width           =   450 
   End 
   Begin VB.Label XmaxValue  
      AutoSize        =   -1  'True 
      Caption         =   "0" 
      Height          =   180 
      Left            =   1440 
      TabIndex        =   5 
      Top             =   960 
      Width           =   90 
   End 
   Begin VB.Label XMAX  
      AutoSize        =   -1  'True 
      Caption         =   "XMAX:" 
      Height          =   180 
      Left            =   840 
      TabIndex        =   4 
      Top             =   960 
      Width           =   450 
   End 
   Begin VB.Label Label1  
      AutoSize        =   -1  'True 
      Caption         =   "请选择层:" 
      Height          =   180 
      Left            =   360 
      TabIndex        =   3 
      Top             =   120 
      Width           =   810 
   End 
End 
Attribute VB_Name = "FrmEntireLayer" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
 
Private Sub Combo1_Click() 
    Dim rect As MapXLib.Rectangle 
     
    If Combo1.Text <> "All Layers" Then 
        Set rect = Formmain.Map1.Layers(Combo1.Text).Bounds 
        XmaxValue = Str(rect.Xmax) 
        YmaxValue = Str(rect.Ymax) 
        XminValue = Str(rect.Xmin) 
        YminValue = Str(rect.Ymin) 
    End If 
    Set rect = Nothing 
     
End Sub 
 
Private Sub Command1_Click() 
     
    Dim lyr As MapXLib.layer 
         
    On Error GoTo error1 
     
    Formmain.Map1.NumericCoordSys = Formmain.Map1.DisplayCoordSys 
     
    If Combo1.Text = "All Layers" Then 
        Set Formmain.Map1.Bounds = Formmain.Map1.Layers.Bounds 
    Else 
       Set lyr = Formmain.Map1.Layers(Combo1.Text) 
       Set Formmain.Map1.Bounds = lyr.Bounds 
    End If 
     
    Unload Me 
 
error1: 
    Select Case Err.Number 
       Case 1074 
         MsgBox "在图层中没有发现对象", , "警告" 
         Unload Me 
    End Select 
     
     
End Sub 
 
Private Sub Command2_Click() 
    Unload Me 
End Sub 
 
Private Sub Form_Load() 
    Dim lyr As MapXLib.layer 
     
    For Each lyr In Formmain.Map1.Layers 
       Combo1.AddItem lyr.name 
    Next 
     Combo1.AddItem "All Layers" 
          
     Combo1.ListIndex = 0 
     
End Sub