Scrollbar in ListIconGadget

Just starting out? Need help? Post your questions and find answers here.
johnnyutah
User
User
Posts: 27
Joined: Sat Oct 16, 2004 1:25 pm

Scrollbar in ListIconGadget

Post by johnnyutah »

Hi,

I was just wondering whether anyone knows how to detect if a vertical scrollbar is showing in a ListIconGadget. I need to change the size of the ListIconGadget columns if the vertical scrollbar is showing to prevent the horizontal scrollbar from displaying.

Thanks
horst
Enthusiast
Enthusiast
Posts: 197
Joined: Wed May 28, 2003 6:57 am
Location: Munich
Contact:

Re: Scrollbar in ListIconGadget

Post by horst »

Send a message (after output):

SendMessage_(ListHandle,#LVM_SETCOLUMNWIDTH,n,#LVSCW_AUTOSIZE_USEHEADER)

where n is the last column.
This will do the job automagically.
You can also send this message each time after resizing is finished (but you need a callback to catch the event).
Horst.
johnnyutah
User
User
Posts: 27
Joined: Sat Oct 16, 2004 1:25 pm

Post by johnnyutah »

Thanks horst! I had a few problems getting this to work and in case anyone has to do this in future the actual code I used was:

SendMessage_(GadgetID(#ListIconGadget), #LVM_SETCOLUMNWIDTH, 1, #LVSCW_AUTOSIZE_USEHEADER)

where #ListIconGadget is the ListIconGadget identifier number/constant. The only difference is that I added GadgetID, which may seem obvious but not to someone who's still learning!
Post Reply