Board index » cppbuilder » TListView: scrolling problem

TListView: scrolling problem

Hi,

How do I let a ListView scroll when adding items to it ?
So that when the adding is done, the last item is at the bottom of the
listview ?

Thanks in advance,

Daniel

 

Re:TListView: scrolling problem


Hi Philipp,

Quote
> How do I let a ListView scroll when adding items to it ?
> So that when the adding is done, the last item is at the
> bottom of the listview ?

You can use the TListItem::MakeVisible() member function...

   ListView1->Items->BeginUpdate();
   try
   {
      // add your items...
   }
   catch (...)
   {
      ListView1->Items->EndUpdate();
   }
   ListView1->Items->EndUpdate();

   const unsigned int last_index = ListView1->Items->Count - 1;
   ListView1->Items->Item[last_index]->MakeVisible(false);

Good luck,
--
Damon Chandler (TeamB)
- http://graphicsBB.itgo.com
- http://bcbcaq.freeservers.com
- http://homepages.go.com/~damonchandler/vcl_faq.zip

Other Threads