Daryl Posted August 19, 2010 Report Share Posted August 19, 2010 I have a program that runs a number of tests automatically. It displays some information about all of the tests "queued" and highlights the row of the test currently executing in a multi-column listbox. There may be 50-60 of these tests listed in rows of the listbox but the listbox only displays maybe 10 or 12 rows at a time (which means the user has to use the scroll bars at some point to see the currently active test). Is there a way to make sure that the test currently being executed is always centered within the listbox so the user does not have to use to scoll bar to find the highlighted row? Quote Link to comment
Ton Plomp Posted August 19, 2010 Report Share Posted August 19, 2010 I have a program that runs a number of tests automatically. It displays some information about all of the tests "queued" and highlights the row of the test currently executing in a multi-column listbox. There may be 50-60 of these tests listed in rows of the listbox but the listbox only displays maybe 10 or 12 rows at a time (which means the user has to use the scroll bars at some point to see the currently active test). Is there a way to make sure that the test currently being executed is always centered within the listbox so the user does not have to use to scoll bar to find the highlighted row? A little mathematics will help you on this, you can get the total number of visible rows (12), and you know your current row number (say 55), the you should programatically (how do you spell that?) set the top.row to 49. Ton Quote Link to comment
Daryl Posted August 19, 2010 Author Report Share Posted August 19, 2010 (edited) A little mathematics will help you on this, you can get the total number of visible rows (12), and you know your current row number (say 55), the you should programatically (how do you spell that?) set the top.row to 49. Ton Is there a property or something for setting the top row? Maybe I just havent had enough coffee yet Nevermind, I just found it Edited August 19, 2010 by Daryl Quote Link to comment
Antoine Chalons Posted August 19, 2010 Report Share Posted August 19, 2010 Is there a property or something for setting the top row? Maybe I just havent had enough coffee yet Yep, "Top Left Visible Cell". See this quick and dirty example : Hope this helps Quote Link to comment
Daryl Posted August 19, 2010 Author Report Share Posted August 19, 2010 Yep, "Top Left Visible Cell". See this quick and dirty example : Hope this helps Thanks Antoine, this was much easier than I thought Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.