|
|
|
|
|
Dicas
|
|
Visual Basic (ActiveX/Controles/DLL)
|
|
|
Título da Dica: Saber se um texto existe em um combobox/listbox
|
|
|
|
Postada em 22/10/2003 por ^HEAVY-METAL^
Private Const LB_FINDSTRING = &H18F Private Const LB_FINDSTRINGEXACT = &H1A2 Private Const CB_FINDSTRING = &H14C Private Const CB_FINDSTRINGEXACT = &H158
Private Declare Function SendMessageByString& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String)
Function procura(sStringToFind, objeto As Object) As Boolean procura = SendMessageByString(objeto.hwnd, CB_FINDSTRING, -1, sStringToFind) >= 0 End Function
Private Sub Command1_Click() MsgBox procura("test", Combo1) End Sub
Private Sub Form_Load() Combo1.AddItem "teste" End Sub
T+,
|
|
|
|
|