Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Scrolling Owner Drawn Listbox

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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

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 …
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…

670 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