NO

Author Topic: Scrolling a window  (Read 2786 times)

tpekar

  • Guest
Scrolling a window
« on: August 24, 2011, 04:18:29 PM »
I have a window and have specified WS_HSCROLL and WS_VSCROLL.  As a result, the scroll bars appeared on the right side and bottom of the screen.  But the screen will not scroll when I try to use them.  Is there something else I need to do?

CommonTater

  • Guest
Re: Scrolling a window
« Reply #1 on: August 24, 2011, 04:27:39 PM »
Is the image/text/content of the window bigger than the window?

As a rule most windows controls supply their own scroll bars ... For example: if you specify WS_VSCROLL when making a list box the scroll bar will pop into view and will work as soon as the list is taller than the window....

To scroll content in the main window you have to write your own scrolling code by handling the WM_VSCROLL and WM_HSCROLL messages.


tpekar

  • Guest
Re: Scrolling a window
« Reply #2 on: August 24, 2011, 07:32:59 PM »
The text fits in the window on my desktop.  But when I load onto my netbook, part of it does not show.  Also, when I try to tab to the text box beyond the visible controls, the window does not shift to show where my cursor is.

CommonTater

  • Guest
Re: Scrolling a window
« Reply #3 on: August 24, 2011, 10:22:14 PM »
Ok, are you using an edit control or are you drawing the text on the window yourself?

If you're using an edit control it should supply it's own scroll bars when you use the WS_VSCROLL and WS_HSCROLL styles.

If you are drawing the text yourself, then you need to process the WM_VSCROLL and WM_HSCROLL messages yourself... that is, you have to redraw the text according to the scroll bar positions.


It might help if you could post the relevant parts of your code...