Solved

Scrolling Owner Drawn Listbox

Posted on 1997-03-26
1
476 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
ID: 1334240
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
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…

808 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