I have an instance of a CXTResizeFormView. I am trying to manually position a button within the view. I call the view's GetClientRect to obtain the view's client area and then call MoveWindow with coordinates (0,0) to try to position the button at the top left of the view.
The rectangle that is being returned does not correspond to the entire scrollable area. Instead, I am getting a rectangle that corresponds to the current visible area that is being scrolled. I need the rectangle that corresponds to the entire scrollable area.
What happens is that if I vertically scroll the view half way down and then invoke MoveWindow, passing it the coordinate (0,0) - the button is getting placed at the top of the visible window which is actually the middle of the entire view.
I would expect it to look like this: --------------------------------------------------------------- [ Button ]
[ Scrollbar Thumb ]
-----------------------------------------------------------------
but instead, it looks like this:
---------------------------------------------------------------
[ Button ] [ Scrollbar Thumb ]
-----------------------------------------------------------------
If I scroll the thumb all the way up to the top first then it works. But otherwise there is a gap between the top of the actual view and where the button is placed.
Why does GetClientRect not return the rectangle that corresponds to the entire view? How am I supposed to use MoveWindow with CXTResizeFormView if client coordinates are unreliable?
Thanks.
-David
|