Restored from previous forum. Originally posted by Justin.
Is there any way to have a multiple selection listview?
Multiplesel listview
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Justin.
Any workarounds until we wait for the next release?
i tried changing the style with api calls but it does not work:
hlist=ListViewGadget(1, 10, 10, 100, 100)
oldstyle=getwindowlong_(hlist,#GWL_STYLE)
SetWindowlong_(hlist,#GWL_STYLE,oldstyle Or #LBS_MULTIPLESEL)
Any workarounds until we wait for the next release?
i tried changing the style with api calls but it does not work:
hlist=ListViewGadget(1, 10, 10, 100, 100)
oldstyle=getwindowlong_(hlist,#GWL_STYLE)
SetWindowlong_(hlist,#GWL_STYLE,oldstyle Or #LBS_MULTIPLESEL)
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Justin.
wich message do i have to send?
with the code i posted the listbox does not appear in the parent window, there are a lot of listbox messages:
http://msdn.microsoft.com/library/en-us ... e#messages
but if the listbox is not there..., has this been done before?
wich message do i have to send?
with the code i posted the listbox does not appear in the parent window, there are a lot of listbox messages:
http://msdn.microsoft.com/library/en-us ... e#messages
but if the listbox is not there..., has this been done before?
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Danilo.
Sorry, Justin - my fault.
Your error: "oldstyle Or #LBS_MULTIPLESEL"
"OR" is logical "OR" and gives back 0 or 1.
What you need here is a bitwise "OR", so
you have to use "|" for "OR".
AND, OR,.. = LOGICAL (return 0 or 1)
|, &,... = BITWISE
Complete example:
Start this little code and select the items.
Hold down SHIFT or CTRL (STRG) for selecting.
cya,
...Danilo
(registered PureBasic user)
Sorry, Justin - my fault.
Your error: "oldstyle Or #LBS_MULTIPLESEL"
"OR" is logical "OR" and gives back 0 or 1.
What you need here is a bitwise "OR", so
you have to use "|" for "OR".
AND, OR,.. = LOGICAL (return 0 or 1)
|, &,... = BITWISE
Complete example:
Code: Select all
OpenWindow(0,10,10,400,400,#PB_Window_SystemMenu,"ListBox")
CreateGadgetList(WindowID())
hlist=ListViewGadget(1, 10, 10, 380, 380)
oldstyle=getwindowlong_(hlist,#GWL_STYLE)
SetWindowlong_(hlist,#GWL_STYLE,oldstyle | #LBS_EXTENDEDSEL );| #LBS_MULTIPLESEL)
For a = 1 To 100
AddGadgetItem(1,-1,"TEST "+Str(a))
Next a
Repeat
Until WaitWindowEvent() = #PB_EventCloseWindow
Hold down SHIFT or CTRL (STRG) for selecting.
cya,
...Danilo
(registered PureBasic user)
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm