?
Solved

CListBox Vertical Scroll Bar Auto-Scroll?

Posted on 1998-04-01
3
Medium Priority
?
1,364 Views
Last Modified: 2013-11-20
Can anyone tell me how to make ListBox Vertical scroll bar automatically scrolled down to the latest item added just like the way edit box does to its incoming data?
0
Comment
Question by:sllsgl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 30 total points
ID: 1317364
Use CListBox.SetCaretIndex(index, TRUE);

The TRUE indicates to scroll to it. The index is the item to scrolled to. So whenever you add an item, save the returned index from AddString() and use that in SetCaretIndex().
0
 

Author Comment

by:sllsgl
ID: 1317365
I have to try it out, thui, earlier 2 helpful guys suggested using SetCurSel(), I have yet to test all these out.  Wait for my outcome :)

Anyway, thanks alot :)
0
 

Author Comment

by:sllsgl
ID: 1317366
Hi, thui, SetCaretIndex() is the right way :)  For the 2nd parameter, using FALSE is better as the whole item can be  visible, making the effect "Auto VScroll" better :)
Using TRUE may sometimes show the added item only partially.
Anyway, it's a good answer many ppl is looking forward to.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question