how to scroll a listbox?

PrimeMov3r
03-21-2002, 06:28 PM
The dilema is this:

I've got a CListBox right and it gets filled with the AddString(..) and the vertical scroll is enabled. But as the list gets filled and the vscrollbar appears, it doesn't autoscroll down to show the newly added string. Is there a event that can be fired or some way of achieving this effect? Any suggestions would likely help.
Oh another thing I should mention is that the Listbox isn't in the tabstop, so it never really has focus.

JDT
04-20-2002, 11:23 AM
I looks like you might be using MFC. This is how you would do it with the API. Send the LB_ADDSTRING message via SendMessage and its return value will be the index of the newly added list item. Use that valeu as the WPARAM and send the LB_SETITEMDATA message.

I have not tested it but that should do it.


Good Luck.


JDT

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum