I have this list in a GUI. Good for me really. Now I have two buttons (one that scrolls up the list and one that scrolls down).
I did a search, but I couldn't find what I wanted. What I want is ten bucks on my PAYPAL account, and someone to tell me how to turn off and on the buttons only when necessary. I don't want them to be constantly on.
The list can contain about 10 items. When items 1-10 are visible scroll down should be available. When items 2-11 are visible scroll up should be available and scroll down too (if number of items >11). if items are less than 11 there's no point scrolling the list is there.
This is just an example.
Use ListBox.TopItem to check the position. For instance, if the value is 0 make the up-arrow invisible, otherwise make it visible. Is that what you're looking for?
// repeatedly_execute
btnScrollUp.Visible = (lstItems.TopItem != 0);
btnScrollDown.Visible = ((lstItems.TopItem + lstItems.RowCount) < lstItems.ItemCount);
Quote from: monkey_05_06 on Mon 19/04/2010 04:03:52
// repeatedly_execute
btnScrollUp.Visible = (lstItems.TopItem != 0);
btnScrollDown.Visible = ((lstItems.TopItem + lstItems.RowCount) < lstItems.ItemCount);
Well, I never thought this was possible. Thanks a lot Monkey!
Sure thing Dual. :)
Haven't you learned to be careful about thinking things are impossible in AGS yet?? :P
Quote from: monkey_05_06 on Tue 20/04/2010 00:17:50
Sure thing Dual. :)
Haven't you learned to be careful about thinking things are impossible in AGS yet?? :P
..you teaser you!...
But nevertheless a really nice trick. Instead of using if statements, this could really come in totally handy!