Page 1 of 1

Scrollbar in ListIconGadget

Posted: Sat Nov 13, 2004 2:43 pm
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

Re: Scrollbar in ListIconGadget

Posted: Sat Nov 13, 2004 4:03 pm
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).

Posted: Sat Nov 13, 2004 6:56 pm
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!