Posted: Wed Sep 02, 2009 6:11 pm
oh, i need same code for a SetSortedCombobox after executed my project:
Work:
Don't work:
Masters ,Help
Merci
Work:
Code: Select all
; http://www.purebasic.com
; Author: Andre Beer (updated for PB4.00 by blbltheworm)
; Date: 27. May 2003
; OS: Windows
; Demo: No
If OpenWindow(0,100,130,220,100,"ComboBox Sorted",#PB_Window_SystemMenu)
If WindowID(0)
cb.l = ComboBoxGadget(1,10,10,200,25,#CBS_SORT)
SendMessage_(cb,#CB_ADDSTRING,0,"3") ; the items will be added in random order
SendMessage_(cb,#CB_ADDSTRING,0,"4")
SendMessage_(cb,#CB_ADDSTRING,0,"1") ; .... but they will be displayed in sorted order
SendMessage_(cb,#CB_ADDSTRING,0,"2")
EndIf
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf
; IDE Options = PureBasic v4.00 (Windows - x86)
; Folding = -
; EnableXP
Code: Select all
; http://www.purebasic.com
; Author: Andre Beer (updated for PB4.00 by blbltheworm)
; Date: 27. May 2003
; OS: Windows
; Demo: No
If OpenWindow(0,100,130,220,100,"ComboBox Sorted",#PB_Window_SystemMenu)
If WindowID(0)
cb.l = ComboBoxGadget(1,10,10,200,25)
;------------------
SetWindowLong_(GadgetID(1), #GWL_STYLE, GetWindowLong_(GadgetID(1), #GWL_STYLE) | #CBS_SORT);<<<<<<<<<<<<<<<<<<<<<<
;------------------
SendMessage_(cb,#CB_ADDSTRING,0,"3") ; the items will be added in random order
SendMessage_(cb,#CB_ADDSTRING,0,"4")
SendMessage_(cb,#CB_ADDSTRING,0,"1") ; .... but they will be displayed in sorted order
SendMessage_(cb,#CB_ADDSTRING,0,"2")
EndIf
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf
; IDE Options = PureBasic v4.00 (Windows - x86)
; Folding = -
; EnableXPMerci