Board index » cppbuilder » ListBox Question

ListBox Question

Hello,
I would like to know how I can advance programatically to the bottom of a
TListBox component as I add items to it. I'm using the TListBox to add
messages generated fro m the application for the user to read.

TIA,
Bill

 

Re:ListBox Question


Try setting the TopIndex property each time you add a new item

Gambit

Quote
"Bill Bastion" <pac...@dicksonsgifts.com> wrote in message

news:3b55dc63_1@dnews...
Quote
> I would like to know how I can advance programatically to the bottom of a
> TListBox component as I add items to it. I'm using the TListBox to add
> messages generated fro m the application for the user to read.

Re:ListBox Question


Something like this:

void __fastcall ScrollInView(TListBox *LB)
{
   LB->TopIndex = (LB->Items->Count - (LB->Height / LB->ItemHeight))+1;

Quote
}

Eric

Quote
"Bill Bastion" <pac...@dicksonsgifts.com> wrote in message

news:3b55dc63_1@dnews...
Quote
> Hello,
> I would like to know how I can advance programatically to the bottom of a
> TListBox component as I add items to it. I'm using the TListBox to add
> messages generated fro m the application for the user to read.

> TIA,
> Bill

Other Threads