Jump to content

CreateList box is always sorted?


Recommended Posts

Hi,

**FIXED IT :) **

$lstResults = GuiCtrlCreateList("", 140, 100, 240, 175,$WS_BORDER + $WS_VSCROLL)

:D

I've created a very simple GUI with;

GuiCreate("myApp Tester v1.00", 390, 286,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Group_1 = GuiCtrlCreateGroup("Output Filename", 10, 10, 370, 50)

$txtFilename = GuiCtrlCreateInput("c:\myApp\TestResults.txt", 20, 30, 350, 20)

$cmdRun = GuiCtrlCreateButton("Run Test Script", 10, 100, 120, 40)

$lstResults = GuiCtrlCreateList("", 140, 100, 240, 175,-1)

but when I add items to the $lstResults with;

GUICtrlSetData($lstResults,"")

GUICtrlSetData($lstResults,"a")

GUICtrlSetData($lstResults,"r")

GUICtrlSetData($lstResults,"c")

GUICtrlSetData($lstResults,"t")

GUICtrlSetData($lstResults,"z")

GUICtrlSetData($lstResults,"e")

the list box is sorted.

I haven't told the style to be $LBS_SORT though???!!

(btw: when I ran this code example for the first time, it wasn't sorted, but now, each time I run it, it is always sorted)

any ideas?

thanks,

Phil.

Edited by TwisterWare
Link to post
Share on other sites

Define your own styles to the list control. LBS_SORT is one of the default ones, so if you don't specify a style it'll always be sorted.

[quote name='Valik' post='301213' date='Jan 31 2007, 10:36 PM']You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.[/quote][font="Lucida Sans Unicode"][/font]

Link to post
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...