Print Page | Close Window

GetClientRect and CXTResizeFormView

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=17753
Printed Date: 19 June 2025 at 3:54pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: GetClientRect and CXTResizeFormView
Posted By: AZDavidPhx
Subject: GetClientRect and CXTResizeFormView
Date 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 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net