Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Visual Basic >> Snippet

Listbox - use API to select all


Private Declare Function SendMessageString Lib "user32" _
    Alias "SendMessageA" _
   ( ByVal hwnd As Long , _
    ByVal wMsg As Long , _
    ByVal wParam As Long , _
    ByVal lParam As String ) As Long
Const WM_USER = &H400
Const LB_SETSEL = (WM_USER + 6)

iReturn = SendMessage(lst.Wnd, LB_SETSEL, bState, - 1