Solved

CListBox Vertical Scroll Bar Auto-Scroll?

Posted on 1998-04-01
3
1,280 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
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 10 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Different colored text in ComboBox without Subclassing 8 55
How to calculate times for developing software? 8 65
deburging in oracle form 12 87
fizzArray2 challenge 1 71
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…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

932 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now