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

📄 testlboxex.frm

📁 VB圣经
💻 FRM
字号:
VERSION 5.00
Object = "{409E6F51-B83C-11D0-A760-00A0C91110C3}#5.0#0"; "LBoxEx.ocx"
Begin VB.Form frmTestLBoxEx 
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5055
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   5055
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command1 
      Caption         =   "Message"
      Default         =   -1  'True
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   3240
      TabIndex        =   2
      Top             =   2745
      Width           =   1725
   End
   Begin VB.OptionButton Option1 
      Caption         =   "Implements"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Index           =   1
      Left            =   1215
      TabIndex        =   1
      Top             =   2700
      Value           =   -1  'True
      Width           =   1905
   End
   Begin VB.OptionButton Option1 
      Caption         =   "Event"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Index           =   0
      Left            =   45
      TabIndex        =   0
      Top             =   2700
      Width           =   1725
   End
   Begin LBEx.ListBoxEx ListBoxEx1 
      Height          =   1995
      Left            =   90
      TabIndex        =   3
      Top             =   90
      Width           =   3435
      _ExtentX        =   6059
      _ExtentY        =   3519
      Appearance      =   0
      IntegralHeight  =   -1  'True
      StoreData       =   0   'False
      StoreStrings    =   0   'False
      Sorted          =   0   'False
      MultiSelect     =   1
      MultiSelectStyle=   1
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
End
Attribute VB_Name = "frmTestLBoxEx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'***************************************************************
' (c) Copyright 2000 Matthew J. Curland
'
' This file is from the CD-ROM accompanying the book:
' Advanced Visual Basic 6: Power Techniques for Everyday Programs
'   Author: Matthew Curland
'   Published by: Addison-Wesley, July 2000
'   ISBN: 0-201-70712-8
'   http://www.PowerVB.com
'***************************************************************
Option Explicit
Implements IQuickNotify

Private Sub Command1_Click()
    MsgBox "Drag over list to test modal drawing."
End Sub

Private Sub Form_Load()
    ListBoxEx1.ListCount = 10000
    Set ListBoxEx1.QuickNotify = Me
End Sub

Private Sub IQuickNotify_ListString(ByVal Index As Long, Text As String)
    Text = "Item " & Index
End Sub

Private Sub IQuickNotify_QuerySetSelection(ByVal Index As Long, ByVal SelState As Boolean, Cancel As Boolean, Message As String, MessageTitle As String, MessageFlags As VbMsgBoxStyle)
    If Index = 5 Then Cancel = True: Message = "Can't set Item 5"
End Sub

Private Sub ListBoxEx1_ListString(ByVal Index As Long, Text As String)
    Text = "Item " & Index
End Sub

Private Sub Option1_Click(Index As Integer)
    If Index Then
        Set ListBoxEx1.QuickNotify = Me
    Else
        Set ListBoxEx1.QuickNotify = Nothing
    End If
End Sub

Private Sub Form_Resize()
Dim yTop As Integer
    yTop = ScaleHeight - Command1.Height * 2
    ListBoxEx1.Move 0, 0, ScaleWidth, yTop
    yTop = yTop + Command1.Height / 2
    Option1(0).Top = yTop
    Option1(1).Top = yTop
    Command1.Top = yTop
End Sub


⌨️ 快捷键说明

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