Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scrolling a list box 1

Status
Not open for further replies.

BeerFizz

Technical User
Jan 23, 2004
28
0
0
Hi,

I would be more than estatic if somone would provide me with a snippet of code to scroll a list box up as strings are being added, so that the last item added is always visable.

I've spent quite a bit of time messing with this and I can' quite get it right.

All help appreciated,
Thanks
phil
 
Assuming : hLB = the handle of your listbox
pText = the text to add
Code:
SendMessage ( hLB,
              LB_SETTOPINDEX,
              (WPARAM)SendMessage ( hLB,
                                    LB_ADDSTRING,
                                    (WPARAM)0,
                                    (LPARAM)pText ),
              (LPARAM)0 );


Marcel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top