C++ Builder Tutorials

C++Builder Tips: Show last line of ListBox

When adding items to a ListBox, there comes a time that the last added item is not visible anymore.

With the following line of code, the ListBox will display all of the last items that fit into the box, with the very last item at the bottom:

ListBox1->TopIndex = ListBox1->Items->Count - 1;