#include <GuiComboBoxEx.au3>
#include <GuiImageList.au3>
#include <GuiConstantsEx.au3>
Opt('MustDeclareVars', 1)
Dim $File ,$var1
$File = @ScriptDir&"\Menu.ini"
$var1 = IniReadSection($File, "在线影视")
$Debug_CB = False ; Check ClassName being passed to ComboBox/ComboBoxEx functions, set to True and use a handle to another control to see it work
_Main()
Func _Main()
Local $hGUI, $hImage, $hCombo,$nMsg,$Button1,$rj
; Create GUI
$hGUI = GUICreate("ComboBoxEx End Update", 400, 300)
$hCombo = _GUICtrlComboBoxEx_Create ($hGUI, "", 2, 2, 394, 100)
$Button1 = GUICtrlCreateButton("测试读取", 50, 100, 65, 25)
GUISetState()
$hImage = _GUIImageList_Create (16, 16, 5, 3)
_GUIImageList_AddIcon ($hImage, "1.ico")
_GUIImageList_AddIcon ($hImage, "2.ico")
_GUIImageList_AddIcon ($hImage, "3.ico")
_GUIImageList_AddIcon ($hImage, "4.ico")
_GUIImageList_AddIcon ($hImage, "5.ico")
_GUIImageList_AddIcon ($hImage, "6.ico")
_GUIImageList_AddIcon ($hImage, "7.ico")
_GUIImageList_AddIcon ($hImage, "8.ico")
_GUIImageList_AddIcon ($hImage, "9.ico")
_GUIImageList_AddIcon ($hImage, "10.ico")
_GUIImageList_AddIcon ($hImage, "11.ico")
_GUIImageList_AddIcon ($hImage, "12.ico")
_GUIImageList_AddIcon ($hImage, "13.ico")
_GUIImageList_AddIcon ($hImage, "14.ico")
_GUIImageList_AddIcon ($hImage, "15.ico")
;_GUIImageList_Add ($hImage, _GUICtrlComboBoxEx_CreateSolidBitMap ($hCombo, 0xFF0000, 16, 16))
;_GUIImageList_Add ($hImage, _GUICtrlComboBoxEx_CreateSolidBitMap ($hCombo, 0x00FF00, 16, 16))
;_GUIImageList_Add ($hImage, _GUICtrlComboBoxEx_CreateSolidBitMap ($hCombo, 0x0000FF, 16, 16))
_GUICtrlComboBoxEx_SetImageList ($hCombo, $hImage)
_GUICtrlComboBoxEx_InitStorage ($hCombo, 150, 300)
_GUICtrlComboBoxEx_BeginUpdate ($hCombo)
For $x = 0 To $var1[0][0]
_GUICtrlComboBoxEx_AddString ($hCombo, $var1[$x][0], $x, $x,-1,-1);_GUICtrlComboBoxEx_AddString ($hCombo, StringFormat("%03d : Random string", Random(1, 200, 1)), $x, $x)
Next
_GUICtrlComboBoxEx_EndUpdate ($hCombo)
;Do
;Until GUIGetMsg() = $GUI_EVENT_CLOSE
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$rj=GUICtrlRead($hCombo)
MsgBox(0,"提示","你选择的是:"&$rj)
EndSwitch
WEnd
EndFunc ;==>_Main