Scrolling a CListBox
-
Hi, I'm having big problems trying to scroll a listbox in code. I can set the scrollbar ok, but I can't figure out how to scroll the text properly. Can anybody suggest how i can instruct a CListBox to scroll by a given amount, and have the listbox take care of updating both the scrollbar and the client area (i.e. have it scroll the text correctly). Clearly CListBox knows how to do this, because if i just grab the scrollbar of a standard CListBox, it works. So how do i ask it to do this for me. Effectively, i want to 'emulate' having dragged the scrollbar. Thanks Jase ------------------------------------------------------------------------------------------------------------------------------------------------------------------- View your digital photos and images with ease using the ultimate desktop image manager for Microsoft Windows Download your free copy of SlideShow Desktop today from http://www.slideshowdesktop.com
-
Hi, I'm having big problems trying to scroll a listbox in code. I can set the scrollbar ok, but I can't figure out how to scroll the text properly. Can anybody suggest how i can instruct a CListBox to scroll by a given amount, and have the listbox take care of updating both the scrollbar and the client area (i.e. have it scroll the text correctly). Clearly CListBox knows how to do this, because if i just grab the scrollbar of a standard CListBox, it works. So how do i ask it to do this for me. Effectively, i want to 'emulate' having dragged the scrollbar. Thanks Jase ------------------------------------------------------------------------------------------------------------------------------------------------------------------- View your digital photos and images with ease using the ultimate desktop image manager for Microsoft Windows Download your free copy of SlideShow Desktop today from http://www.slideshowdesktop.com
Have a look at LB_SETTOPINDEX / CListBox::SetTopIndex. These should help you. Or you could simply send the listbox WM_VSCROLL messages. Iain Clarke.