New topic: 

Number of Visible Rows in a ListBox?

<http://forums.realsoftware.com/viewtopic.php?t=47296>

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        barrytraver          Post subject: Number of Visible Rows in a 
ListBox?Posted: Fri Mar 15, 2013 1:19 pm                         
Joined: Fri Sep 30, 2005 1:53 pm
Posts: 860
Location: Philadelphia, PA                Does the number of visible rows in a 
ListBox vary from one computer to another?

If so, is there a way to find out how many visible rows there are?

Here's my situation.  The rows in the ListBox are expandable.  If the ListBox 
is scrolled all the way up, a click on the bottom row will add two rows.  There 
is NO visible indication that that has happened.  What I want in that situation 
is for the program to scroll up the ListBox two rows (which it can now do) so 
that the two new rows can be seen.  BUT unless rows are added AFTER the 
elements in the ListBox are already scrolled all the way up, I do NOT want the 
ScrollPosition to be changed either up or down.

I know that ScrollPosition tells you what element is at the top of the display, 
but that is not all I need to know.  If I also know the number of visible rows 
in the list box, I can do it.  Similarly, if I know what element is at the 
bottom of the display, I can do it (since from that information I can calculate 
the number of visible rows).

Can that number be calculated?  Is there a need to so?  Or is the number of 
visible rows always the same?  If I'm going about things the wrong way, is 
there another way to accomplish the same objective?

Here's another (hopefully better description of the objective:  The program 
shouldn't mess with the ScrollPosition UNLESS the element showing in the last 
row is two items up from showing the final position.  In that case, then move 
the visible list up two rows.  If that is NOT the case (e.g., if the user is 
looking at the beginning or middle of the list and there are more than two rows 
rows at the end of the list not showing), then do NOT move the list.

It's difficult to describe, but I hope the idea ls fairly clear.  Thanks for 
the help.

Barry Traver   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to