Solved

Scrolling Owner Drawn Listbox

Posted on 1997-03-26
1
468 Views
Last Modified: 2013-12-03
Hello:

     This problem should be easy, but I can't seem to figure  out how to scroll the client area of an owner drawn listbox successfully.  I want the listbox to scroll to its maximum down position (for a vertical scroll bar) each time a new line is added to the listbox.  I've tried ScrollWindowEx() for the client area and SetScrollInfo() for the scroll bar position but i can't seem to get it to work.  This is in Win32 API, using WinMain().  Example code and answers are appreciated.  Thanks in advance,
           Regards,
              Peter Huene
0
Comment
Question by:phuene
1 Comment
 

Accepted Solution

by:
knicolson earned 50 total points
Comment Utility
Try, if it's C:

nIndex = SendMessage( hListBox, LB_GETCOUNT, 0, 0 );
SendMessage( hListBox, LB_SETTOPINDEX, nIndex-1, 0 );

or for C++:

pListBox->SetTopIndex( pListBox->GetCount() - 1 );
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

728 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

9 Experts available now in Live!

Get 1:1 Help Now