Sub FindString(ByVal What As String)
Dim I&
For I = 0 To List1.ListCount - 1
List1.ListIndex = I
If List1.Text = What Then MsgBox "Есть": Exit Sub
Next
MsgBox "Нет"
End Sub
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Any) As Long
Private Const LB_FINDSTRING As Long = &H18F
Sub FindString(ByVal What As String)
Dim Res1&, Res2 As Boolean
Res1 = SendMessage(List1.hWnd, LB_FINDSTRING, -1, What)
Select Case Res1
Case 0
MsgBox "Нет!"
Case Else
MsgBox "Есть!"
End Select
End Sub
If List1.Text = What Then MsgBox "Есть": Exit Sub
If List1.Text = What Then
MsgBox "Есть"
[сюда можно вставить что-то своё]
Exit Sub
End if
Сейчас этот форум просматривают: Yandex-бот и гости: 10