Aceguy Posted June 29, 2006 Share Posted June 29, 2006 heres my code, but would like the contents of the combobox to be sorted.......$CBS_SORT doesnt work. #include <GUIConstants.au3> $my_gui=GUICreate("my gui") $My_list=GUICtrlCreateCombo("",10,10,$CBS_SORT) $var = IniReadSectionNames(@DesktopDir & "\recipes.ini") If @error Then MsgBox(4096, "", "Error occured, probably no INI file.") Else For $i = 1 To $var[0] GUICtrlSetData($my_list,$var[$i]) Next EndIf GUISetState() While 1 $msg=GUIGetMsg() Select case $msg=-3 ExitLoop EndSelect WEnd is it possible, Many thanks. Andy [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
Valuater Posted June 29, 2006 Share Posted June 29, 2006 #include<array.au3> #include <GUIConstants.au3> $my_gui=GUICreate("my gui") $My_list=GUICtrlCreateCombo("",10,10,$CBS_SORT) $var = IniReadSectionNames(@DesktopDir & "\recipes.ini") If @error Then MsgBox(4096, "", "Error occured, probably no INI file.") Else _ArraySort($var) For $i = 1 To $var[0] GUICtrlSetData($my_list,$var[$i]) Next EndIf GUISetState() While 1 $msg=GUIGetMsg() Select case $msg=-3 ExitLoop EndSelect WEnd 8) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 29, 2006 Moderators Share Posted June 29, 2006 (edited) #include <GUIConstants.au3> #include <Array.au3> $my_gui=GUICreate("my gui") $My_list=GUICtrlCreateCombo("",10,10,$CBS_SORT) $var = IniReadSectionNames(@DesktopDir & "\recipes.ini") If @error Then MsgBox(4096, "", "Error occured, probably no INI file.") Else _ArraySort($var, 0, 1) For $i = 1 To $var[0] GUICtrlSetData($my_list,$var[$i]) Next EndIf GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = -3 ExitLoop EndSelect WEnd Edit: Oops, Val was a tad faster.... Edit2: But he forgot to start the sort on 1 Edited June 29, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
GaryFrost Posted June 30, 2006 Share Posted June 30, 2006 (edited) can't believe you both missed this one$My_list=GUICtrlCreateCombo("",10,10,-1,-1,$CBS_SORT)No need for the array sort. Edited June 30, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 30, 2006 Moderators Share Posted June 30, 2006 can't believe you both missed this one$My_list=GUICtrlCreateCombo("",10,10,-1,-1,$CBS_SORT)No need for the array sort.LOL, well I didn't run the combo personally , nice catch. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Valuater Posted June 30, 2006 Share Posted June 30, 2006 can't believe you both missed this one$My_list=GUICtrlCreateCombo("",10,10,-1,-1,$CBS_SORT)No need for the array sort.oooppss8) Link to comment Share on other sites More sharing options...
Aceguy Posted June 30, 2006 Author Share Posted June 30, 2006 (edited) Thanks Guys..... But like i said.... $CBS_SORT doesnt work.... Arraysort Works a Treat. thanks a 1,000,000 tho. Edited June 30, 2006 by Aceguy [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
GaryFrost Posted June 30, 2006 Share Posted June 30, 2006 Thanks Guys..... But like i said.... $CBS_SORT doesnt work.... Arraysort Works a Treat. thanks a 1,000,000 tho. If you create the combo correctly it should. $My_list=GUICtrlCreateCombo("",10,10,-1,-1,$CBS_SORT) SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Aceguy Posted June 30, 2006 Author Share Posted June 30, 2006 Yep Tried that, it sorted the list ok, but the Down Arrow button dissapeared and the list was permanently displayed. ?????? ODD. [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
GaryFrost Posted June 30, 2006 Share Posted June 30, 2006 not odd, changed the style, need to bitor the default styles back in #include <GUIConstants.au3> $my_gui=GUICreate("my gui") $My_list=GUICtrlCreateCombo("",10,10,200,120,BitOR($CBS_SORT,$CBS_DROPDOWN, $CBS_AUTOHSCROLL, $WS_VSCROLL)) $var = IniReadSectionNames(@DesktopDir & "\recipes.ini") If @error Then MsgBox(4096, "", "Error occured, probably no INI file.") Else For $i = 1 To $var[0] GUICtrlSetData($my_list,$var[$i]) Next EndIf GUISetState() While 1 $msg=GUIGetMsg() Select case $msg=-3 ExitLoop EndSelect WEnd SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Aceguy Posted June 30, 2006 Author Share Posted June 30, 2006 have not tried it, but you know your onions from your cabbages.... Thanks gafrost....... [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now