Click to See Complete Forum and Search --> : Scrollbars


ruderudy
June 21st, 2009, 09:58 AM
I have a question for experienced win32 api coders.
My problem is this:

I have a dialog with a listbox. this listbox are updated with strings sometimes while program is running. i want to add a scrollbar, but i dont know where to put it? inside the listbox (if that is possible?) or beside the borders of the dialog. maybe there's a way to scroll the contents of the listbox while using the latter option. since i dont think the best way is to make a long listbox inside the client-area of the dialog and then scroll the client area of the dialog to show the contents. but scroll the contents of the clientarea of the listbox. what is your thoughts on that?

hoxsiew
June 21st, 2009, 11:14 AM
Why not add the WS_VSCROLL style to the list box control and let it handle it's own scrolling?

_Superman_
June 21st, 2009, 11:19 AM
Listbox has a built-in scroll bar. You only have to set its Vertical Scrollbar property to true.

ruderudy
June 21st, 2009, 11:57 AM
I just thought i had to handle the scrolling stuff for myself, but it worked very nice!
So thanks alot.
i sometimes make things too difficult for myself. hehe