I have a debug window that is showing the communication in and out of the serial port. The data is displayed in a TListBox and I need to scroll the listbox so that the last line of data is always showing.
I know that setting TopIndex will force the listbox to show the last entries, but I can't see how to determine how many lines fit in the window. Under Windows, it is easy, because the font is standard and the number of lines probably won't change, so I could hard code it. But this program will be compiled for Linux as well and the font can be changed by the user.
I thought ItemHeight might give the height of a line in pixels, which I could devide into the list box height, but under Windows anyway (which I'm working in now) it appears to return the value zero.