Ver Mensaje Individual
  #4 (permalink)  
Antiguo 06/11/2006, 12:53
Avatar de Korku
Korku
 
Fecha de Ingreso: noviembre-2003
Ubicación: En un lugar oscuro...
Mensajes: 688
Antigüedad: 21 años, 2 meses
Puntos: 5
Código:
Option Explicit

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, _
                                                                        ByVal wMsg As Long, _
                                                                        ByVal wParam As Long, _
                                                                        lParam As Any) _
                                                                        As Long

Private Const CB_ERR = (-1)
Private Const CB_FINDSTRING = &H14C
Private Const CB_FINDSTRINGEXACT = &H158

Private Function FindItemByString(cmb As ComboBox, ByVal SearchFor As String, Optional FindExact As Boolean = False) As Integer
    FindItemByString = CInt(SendMessage(cmb.hwnd, IIf(FindExact, CB_FINDSTRINGEXACT, CB_FINDSTRING), _
                            CB_ERR, ByVal SearchFor))
End Function


Private Sub Command1_Click (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Command1_Click

    Combo1.ListIndex = FindItemByString(Combo1, Combo1.Text, True)

End Sub
Espero que te sirva de algo,

Un saludo
__________________
Carpe diem quam minimum credula postero.


http://www.programador-freelance.es