Search the Community
Showing results for tags 'list; guictrlcreatelist'.
-
Hi, I am trying to get my list displayed in order I press button not in alphabeticall order. I modified example from here Code below. What i want to achieve is to according to pressed button message been displayed in that order. Currently no matter what button in what order I press it is always showing first button NO1 and than button NO2. PLease help. #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Example() Func Example() Local $sMESSAGE = "The following buttons have been clicked" GUICreate("My GUI list") ; will create a dialog box that when displayed is centered Local $idAdd = GUICtrlCreateButton("Add1", 64, 32, 75, 25) Local $idAdd2 = GUICtrlCreateButton("Add2", 64, 52, 75, 25) Local $idClear = GUICtrlCreateButton("Clear", 64, 72, 75, 25) Local $idMylist = GUICtrlCreateList("buttons that have been clicked", 176, 32, 121, 97) GUICtrlSetLimit(-1, 200) ; to limit horizontal scrolling GUICtrlSetData(-1, $sMESSAGE) Local $idClose = GUICtrlCreateButton("my closing button", 64, 160, 175, 25) GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idAdd GUICtrlSetData($idMylist, " button No1|") Case $idAdd2 GUICtrlSetData($idMylist, " button No2|") Case $idClear GUICtrlSetData($idMylist, "") Case $idClose MsgBox($MB_SYSTEMMODAL, "", "the closing button has been clicked", 2) Exit EndSwitch WEnd EndFunc ;==>Example