Jump to content

Searchable Combo?


Recommended Posts

Alright, I built this inventory application for my company, and recently presented it, but after adding all the products to my combo box, it can potentially slow the input process by causing the user to tediously search through the combo drop down... Would it be possible to type the first couple letters of what your searching for, and it single out the list?

I really just need to know if it's easily possible, and if so a small 'push' in the right direction would be heavily appreciated, although if it's more complicated than it's worth... Than does anyone know a better way?

SIGNATURE_0X800007D NOT FOUND

Link to comment
Share on other sites

BinaryBrother

Example:

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiComboBox.au3>

Dim $sString = "Hello|world|AutoIt|rules|and|more|some|data"

$hGUI = GUICreate("Search in combo demo", 300, 200)

$hCombo = GUICtrlCreateCombo("", 70, 75, 170, 20)
GUICtrlSetData(-1, $sString, "Hello")

GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")

GUISetState()

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
    Local $iIDFrom = BitAND($wParam, 0x0000FFFF)
    Local $iCode = BitShift($wParam, 16)
    
    Switch $iIDFrom
        Case $hCombo
            Switch $iCode
                Case $CBN_EDITCHANGE
                    _GUICtrlComboBox_AutoComplete($hCombo)
            EndSwitch
    EndSwitch
    
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_COMMAND

:)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...