Get a listbox setting

Started by John Messingham, January 11, 2010, 10:09:31 AM

Previous topic - Next topic

John Messingham

Hi,

What is the best way to see if a listbox is set to multi select or not through code?
Many Thanks
John Messingham
http://www.jmds.co.uk

Roger Garstang

#1
GetWindowLong API call with GWL_STYLE index and compare with a bitwise AND to the %LBS_* style you want.  Is this your own control or another window?  I'd think you'd know what your own style is set to.  If another window there may be more involved.

John Messingham

Thanks Roger, I appreciate your time.

QuoteIs this your own control or another window?  I'd think you'd know what your own style is set to.

It is my own control. I have code that is accessing the listbox on various forms and sometimes it is set to multi select and sometimes single select. In order to set the current selection or selections the function needs to know how the listbox is setup.
Many Thanks
John Messingham
http://www.jmds.co.uk