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

📄 利用api制作listbox的索引.frm

📁 个人VB学习源码精选,自己学习时的一些编程小程序,希望对大家有帮助
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "搜寻ListBox(使用Windows API)"
   ClientHeight    =   3495
   ClientLeft      =   1515
   ClientTop       =   1575
   ClientWidth     =   3825
   LinkTopic       =   "Form1"
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   3495
   ScaleWidth      =   3825
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   240
      TabIndex        =   0
      Top             =   480
      Width           =   3255
   End
   Begin VB.ListBox List1 
      Height          =   1620
      ItemData        =   "利用API制作ListBox的索引.frx":0000
      Left            =   240
      List            =   "利用API制作ListBox的索引.frx":0184
      TabIndex        =   3
      Top             =   960
      Width           =   3255
   End
   Begin VB.CommandButton Ok 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      Caption         =   "Ok"
      Default         =   -1  'True
      Height          =   495
      Left            =   240
      TabIndex        =   2
      Top             =   2880
      Width           =   1455
   End
   Begin VB.CommandButton Cancel 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      Caption         =   "Cancel"
      Height          =   495
      Left            =   2040
      TabIndex        =   1
      Top             =   2880
      Width           =   1455
   End
   Begin VB.Label Label1 
      Caption         =   "搜寻VB的函数"
      BeginProperty Font 
         Name            =   "PMingLiU"
         Size            =   9
         Charset         =   136
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   240
      TabIndex        =   4
      Top             =   120
      Width           =   1455
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Cancel_Click()
    End
End Sub
                    
Private Sub Ok_Click()
    MsgBox "您选择了" + List1.Text
End Sub

Private Sub Text1_Change()
    Dim Search As String, Index As Long
    
    Search = Text1.Text
    If Len(Search) > 0 Then
        Index = SendMessage(List1.hwnd, LB_SELECTSTRING, -1, ByVal Search)
    Else
        List1.ListIndex = 0
    End If
End Sub

⌨️ 快捷键说明

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