Is there a way to supress the horizontal scroll bars for a ListIconGadget?
When my list gets too long they both appear when only one is needed.
Thanks. Viva La PB!
Surpressing Horiz Scroll Bar
-
- Enthusiast
- Posts: 212
- Joined: Fri Apr 22, 2005 2:07 pm
- Location: U.S.A.
- Contact:
Surpressing Horiz Scroll Bar
-- DB
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage — to move in the opposite direction.
Albert Einstein
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage — to move in the opposite direction.
Albert Einstein
-
- User
- Posts: 82
- Joined: Tue May 03, 2005 2:51 am
- Location: Wheeling, Illinois, USA
- Contact:
I KNOW! I KNOW!
I went through this not long ago.
What happens is when the vertical scroll is added is uses some pixels (about 12) of your ListIconGadget. So if your columns already fill the LIG you need a horizontal scroll.
If you make the ListIconGadget a bit wider (to allow for the vertical scrollbar) you won't get the horizontal scroll bar.
Rand
I went through this not long ago.
What happens is when the vertical scroll is added is uses some pixels (about 12) of your ListIconGadget. So if your columns already fill the LIG you need a horizontal scroll.
If you make the ListIconGadget a bit wider (to allow for the vertical scrollbar) you won't get the horizontal scroll bar.
Rand
-
- User
- Posts: 27
- Joined: Sat Oct 16, 2004 1:25 pm
This is the code I use:
You need to work out how many items the listicongadget can display before it shows the vertical scrollbar. In the example above its 17.
Code: Select all
If CountGadgetItems(#ListIconGadget) > 17
; Resize columns to make them smaller so more space for vertical scrollbar.
SendMessage_(GadgetID(#ListIconGadget), #LVM_SETCOLUMNWIDTH, 0, 90)
SendMessage_(GadgetID(#ListIconGadget), #LVM_SETCOLUMNWIDTH, 1, 90)
Else
; Column size if scrollbar is not displaying
SendMessage_(GadgetID(#ListIconGadget), #LVM_SETCOLUMNWIDTH, 0, 98)
SendMessage_(GadgetID(#ListIconGadget), #LVM_SETCOLUMNWIDTH, 1, 98)
EndIf
Here is my preferred method for avoiding a horizontal scroll bar.
Immediately after adding or deleting a row (and possibly also immediately creating the gadget) include the line:
This gets Windows to automatically adjust the width of the last column so that the columns fit within the gadget.
Immediately after adding or deleting a row (and possibly also immediately creating the gadget) include the line:
Code: Select all
SendMessage_(GadgetID(#ListIconGadget), #LVM_SETCOLUMNWIDTH, last_column_number, #LVSCW_AUTOSIZE_USEHEADER)
Anthony Jordan