|
Сколько элементов выделено |
|
|
Данный пример покажет, сколько всего элементов выделено в ListBox'е. Рсположите на форме 1 ListBox и элемент CommandButton. Установите свойство MultiSelect элемента ListBox в 1 или 2 Private Declare Function SendMessage Lib "user32"
Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As
Long, ByVal lParam As Any) As Long
Const LB_GETSELCOUNT = &H190
Private Sub Form_Load()
List1.AddItem "11"
List1.AddItem "22"
List1.AddItem "33"
List1.AddItem "44"
End Sub
Private Sub Command1_Click()
MsgBox SendMessage(List1.hwnd, LB_GETSELCOUNT, 0&, 0&)
End Sub
|
|
|
|
|
|
|