Sign in to follow this  
Followers 0
odaylton

_GUICtrlComboBox_AutoComplete Update

2 posts in this topic

Text translated from Portuguese by google - please apologize for any errors

I always liked to use it to type something Combobox he should open the list of data and show me a list of options.
With that I made a small change in the original listing for this to work up.

I hope you enjoy it and it becomes default someday

 Em Portugues:

Eu sempre gostei de usar Combobox  ele ao digitar algo ele deveria abrir a lista de dados e me mostrar as opções da lista.

Com isso eu fiz uma pequena mudança na listagem original para que isso funciona-se.

Espero que gostem e que isso se torne padrão algum dia

 

Func _GUICtrlComboBox_AutoComplete($hWnd)
 If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)

 If Not __GUICtrlComboBox_IsPressed('08') And Not __GUICtrlComboBox_IsPressed("2E") Then ;backspace pressed or Del
  Local $sEditText = _GUICtrlComboBox_GetEditText($hWnd)
  ;==>> my update:
  _GUICtrlComboBox_ShowDropDown($hCombo, True)
  ;<<===
  If StringLen($sEditText) Then
   Local $sInputText
   Local $ret = _GUICtrlComboBox_FindString($hWnd, $sEditText)
   If ($ret <> $CB_ERR) Then
    _GUICtrlComboBox_GetLBText($hWnd, $ret, $sInputText)
    _GUICtrlComboBox_SetEditText($hWnd, $sInputText)
    _GUICtrlComboBox_SetEditSel($hWnd, StringLen($sEditText), StringLen($sInputText))
   EndIf
  EndIf
 EndIf
EndFunc   ;==>_GUICtrlComboBox_AutoComplete

 

 

ok...

Share this post


Link to post
Share on other sites



Func _GUICtrlComboBox_AutoComplete($hWnd)
    If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)

    If Not __GUICtrlComboBox_IsPressed('08') And Not __GUICtrlComboBox_IsPressed("2E") Then ;backspace pressed or Del
        Local $sEditText = _GUICtrlComboBox_GetEditText($hWnd)
        ;==>> my update:
        _GUICtrlComboBox_ShowDropDown($hCombo, True)
        ;<<===
        If StringLen($sEditText) Then
            Local $sInputText
            Local $ret = _GUICtrlComboBox_FindString($hWnd, $sEditText)
            If ($ret <> $CB_ERR) Then
                _GUICtrlComboBox_GetLBText($hWnd, $ret, $sInputText)
                _GUICtrlComboBox_SetEditText($hWnd, $sInputText)
                _GUICtrlComboBox_SetEditSel($hWnd, StringLen($sEditText), StringLen($sInputText))
            EndIf
        EndIf
    EndIf
EndFunc   ;==>_GUICtrlComboBox_AutoComplete

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0