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

📄 frmlistchoose.frm

📁 gis地图 --- --- --文字1
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmListChoose 
   BorderStyle     =   4  'Fixed ToolWindow
   Caption         =   "Select Label To Edit"
   ClientHeight    =   3972
   ClientLeft      =   48
   ClientTop       =   288
   ClientWidth     =   4068
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3972
   ScaleWidth      =   4068
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdOK 
      Caption         =   "&OK"
      Default         =   -1  'True
      Height          =   345
      Left            =   3135
      TabIndex        =   1
      Top             =   3555
      Width           =   825
   End
   Begin VB.ListBox lstSelect 
      Height          =   3120
      Left            =   60
      TabIndex        =   0
      Top             =   150
      Width           =   3930
   End
End
Attribute VB_Name = "frmListChoose"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

' Copyright 1995-2004 ESRI

' All rights reserved under the copyright laws of the United States.

' You may freely redistribute and use this sample code, with or without modification.

' Disclaimer: THE SAMPLE CODE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 
' WARRANTIES, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
' FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ESRI OR 
' CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 
' OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
' SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
' INTERRUPTION) SUSTAINED BY YOU OR A THIRD PARTY, HOWEVER CAUSED AND ON ANY 
' THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ARISING IN ANY 
' WAY OUT OF THE USE OF THIS SAMPLE CODE, EVEN IF ADVISED OF THE POSSIBILITY OF 
' SUCH DAMAGE.

' For additional information contact: Environmental Systems Research Institute, Inc.

' Attn: Contracts Dept.

' 380 New York Street

' Redlands, California, U.S.A. 92373 

' Email: contracts@esri.com

Option Explicit
Dim m_iStatus As Integer

Private Sub cmdOK_Click()
On Error Resume Next

    m_iStatus = vbOK
    Me.Hide
    
End Sub



Public Function RunMe(theCol As Collection) As IDDDText

On Error GoTo frmListChoose_ERR

'   return the index of the list selected
    m_iStatus = vbCancel
    
    Dim i As Integer
    Dim pLBL As IDDDText
    Dim sItem As String
    Dim X As Double, Y As Double, z As Double
    
    If theCol Is Nothing Then
        Me.Hide
        Exit Function
    End If
    
    Me.lstSelect.Clear
    For i = 0 To theCol.Count - 1
        Set pLBL = theCol.Item(i + 1)
        X = pLBL.Origin.X
        Y = pLBL.Origin.Y
        z = pLBL.Origin.z
        sItem = Chr(34) & pLBL.Message & Chr(34)
        sItem = sItem & " , " & X & "," & Y & "," & z
        With Me.lstSelect
            .AddItem sItem
        End With
        
    Next
    
    If Me.lstSelect.ListCount > 0 Then Me.lstSelect.ListIndex = 0
    
    Me.Show vbModal
    
    If m_iStatus = vbOK Then
        Set RunMe = theCol.Item(Me.lstSelect.ListIndex + 1)
    End If
        
        
    Exit Function
    
frmListChoose_ERR:
    Debug.Assert 0
    Debug.Print "frmListChoose_ERR: " & err.Description
    Resume Next
    
    
End Function

Private Sub Form_KeyPress(KeyAscii As Integer)
On Error Resume Next

    If KeyAscii = vbKeyEscape Or KeyAscii = vbKeyCancel Then
        m_iStatus = vbCancel
        Me.Hide
    End If
End Sub

Private Sub lstSelect_DblClick()
On Error Resume Next

    m_iStatus = vbOK
    Me.Hide
    
End Sub


Private Sub lstSelect_KeyPress(KeyAscii As Integer)
On Error Resume Next

    If KeyAscii = vbKeyEscape Or KeyAscii = vbKeyCancel Then
        m_iStatus = vbCancel
        Me.Hide
    End If
End Sub


⌨️ 快捷键说明

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