'
Code:
'PBWIN 9.00 - WinApi 05/2008 - XP Pro SP3 #Compile Exe #Include "WIN32API.INC" Function PBMain Global hdlg As Dword Dialog New Pixels, hdlg, "ListBox sorts", , , 400, 400, %WS_SYSMENU To hdlg Local Wdth&, Hght&, Stile&, ctr&, ctr1&, t$, StartAt& Local Id1&, id2&, id3&, a$(), b$(), c$() Local StileA&, StileB&, StileC& 'build arrays ctr = 25 Dim a$(ctr), b$(ctr), c$(ctr) For ctr = LBound(a$()) To UBound(a$()) 'random string t$ = String$(10, Chr$(Rnd(65, 90))) ctr1 = Rnd(1, 2) If ctr1 = 1 Then t$ = "_" & t$ a$(ctr) = t$ b$(ctr) = t$ c$(ctr) = t$ Next ctr Array Sort c$() Wdth = 100 Hght = 300 StartAt = 10 StileA = %LBS_NOINTEGRALHEIGHT Or %WS_VSCROLL Or %LBS_NOTIFY 'no sort Control Add Label, hdlg, -1, "Original Unsorted", StartAt + 5, 1, Wdth, 14 Control Add ListBox, hdlg, id1, a$(), StartAt, 16, Wdth, Hght, StileA StartAt = StartAt + Wdth + 40 StileB = %LBS_STANDARD 'includes sort style Control Add Label, hdlg, -1, "Listbox Sorted", StartAt, 1, Wdth, 14 Control Add ListBox, hdlg, id2, b$(), StartAt, 16, Wdth, Hght, StileB StartAt = StartAt + Wdth + 40 StileC = StileA 'no sort Control Add Label, hdlg, -1, "Array Sorted", StartAt, 1, Wdth, 14 Control Add ListBox, hdlg, id3, c$(), StartAt, 16, Wdth, Hght, StileC Dialog Show Modal hDlg End Function ' '
Comment