Solved

Scrolling Owner Drawn Listbox

Posted on 1997-03-26
1
485 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
[X]
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
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

630 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