Jump to content

List controls are always alphabetized?


Recommended Posts

I have created a small script to isolate the issue I am having. I want to have a list that is NOT alphabetized. After scouring the help file I was able to find that there are styles $LBS_SORT and $LBS_STANDARD but according to their descriptions, they sort the strings alphabetically. I see no style for not sorting.

#Include <Array.au3>

; Create array containing items in the list.
Local $aArray[7] = [ 6, 'One', 'Two', 'Three', 'Four', 'Five', 'Six' ]

; Display the array just to prove everything is in order.
_ArrayDisplay ( $aArray )

; Create GUI with list containing items in the array
Local $hGUI = GUICreate ( 'Out of order', 300, 250 )
Local $idList = GUICtrlCreateList ( 'One', 10, 10, 280, 100 )
Local $idButtonExit = GUICtrlCreateButton ( 'Exit', 185, 210, 100, 25 )
For $iFoo = 2 to 6
    GUICtrlSetData ( $idList, $aArray[$iFoo] & '|' )

; Display the GUI
GUISetState ( @SW_SHOW, $hGUI )
While 1
    If GUIGetMsg() = $idButtonExit Then ExitLoop



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

  • Recently Browsing   0 members

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