Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Scrolling Owner Drawn Listbox

Posted on 1997-03-26
1
Medium Priority
?
490 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 100 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

916 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