Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - GetClientRect and CXTResizeFormView
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

GetClientRect and CXTResizeFormView

 Post Reply Post Reply
Author
Message
AZDavidPhx View Drop Down
Newbie
Newbie


Joined: 14 August 2010
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote AZDavidPhx Quote  Post ReplyReply Direct Link To This Post Topic: GetClientRect and CXTResizeFormView
    Posted: 05 January 2011 at 6:26pm
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 
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.031 seconds.