Solved

CListBox Vertical Scroll Bar Auto-Scroll?

Posted on 1998-04-01
3
1,269 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now