Melba23,tnx. i think, this is the best way for create what i want, very tnx. this is my simple code with comboBox(simple style) But still Melba23's way is better and more complete. #include <GuiComboBoxEx.au3>
#include <GuiImageList.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
$iY=20
_Main()
Func _Main()
Global $hGUI, $hImage, $hCombo
; Create GUI
$hGUI = GUICreate("ComboBox", 400, 300)
$hCombo = GUICtrlCreateCombo ("", 2, 2, 394, $iY , BitOR($CBS_SIMPLE, $WS_VSCROLL, $WS_BORDER))
GUICtrlSetData(-1, "B1|B2|B3|B4|B5")
GUISetState()
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc ;==>_Main
Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg
Local $hWndFrom, $iIDFrom, $iCode, $hWndCombo
If Not IsHWnd($hCombo) Then $hWndCombo = GUICtrlGetHandle($hCombo)
$hWndFrom = $ilParam
$iIDFrom = BitAND($iwParam, 0xFFFF)
$iCode = BitShift($iwParam, 16)
Switch $hWndFrom
Case $hCombo, $hWndCombo
Switch $iCode
Case $CBN_EDITCHANGE ; Sent after the user has taken an action that may have altered the text in the edit control portion of a combo box
$combo_text = _GUICtrlComboBox_GetEditText($hCombo)
If (Not StringIsSpace($combo_text)) And $combo_text<>"" Then
iCombo_Resize(1)
Else
iCombo_Resize(0)
EndIf
; no return value
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>
Func iCombo_Resize($flag) ; Flag=1(Show List), else flag(Hide List)
$iY =20
If $flag=1 Then
$count = _GUICtrlComboBox_GetCount($hCombo)
For $i=1 to $count
$iY +=15
Next
EndIf
GUICtrlSetPos($hCombo,2, 2, 394, $iY)
EndFunc