PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: John Messingham on January 11, 2010, 10:09:31 AM

Title: Get a listbox setting
Post by: John Messingham on January 11, 2010, 10:09:31 AM
Hi,

What is the best way to see if a listbox is set to multi select or not through code?
Title: Re: Get a listbox setting
Post by: Roger Garstang on January 11, 2010, 11:11:42 AM
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.
Title: Re: Get a listbox setting
Post by: John Messingham on January 11, 2010, 12:30:13 PM
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.