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
Solved

CListBox Vertical Scroll Bar Auto-Scroll?

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.

861 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