Obtaining Dimensions of the Client Area |
Post Reply |
Author | |
Eugene
Newbie Joined: 30 December 2005 Status: Offline Points: 3 |
Post Options
Thanks(0)
Posted: 03 January 2006 at 10:40am |
Hello,
We are developing a VB 6.0 application. We’ve recently purchased a 4-developer license for the Xtreme Pro Suite. We are using Commandbars for the menus, toolbar, status bar, and MDI tabbed workspace. However, we haven’t been able to figure out how to calculate the full client area available for a given form. We need to know this in order to re-position and re-size the controls to allow the form to work in various resolutions. We’ve tried the following: 'Calculate the height and width of the client area. Dim lLeft As Long, lTop As Long, lRight As Long, lBottom As Long CommandBars.GetClientRect lLeft, lTop, lRight, lBottom lClientWidth = lRight - lLeft lClientHeight = lBottom – lTop I’ve then assigned these values to Width and Height within
the MDI child form. However, the values returned by GetClientRect are not even
remotely correct. I presume that GetClientRect returns the full area from the
toolbar (assuming the toolbar is at the top of the screen), to the status bar,
and from the left and right sides of the MDI form (assuming no docked items).
Is this correct? Is there some other function we should be using? When we make a call to GetClientRect, we end up with a width of 4680 and a height of 1725. This is far from the actual client area of about 11,500 by 5,750 (on our test machine). Note, in case it makes a difference to how GetClientRect does its calculations, within our forms we are using the Sizer tool from ComponentOne (specifically, the C1 Elastic component). This allows us to re-size components and sections of our forms. In the samples, the MDI child form always seems to have Top,
Left, Width, and Height set within Form_Load. The values assigned to Width and
Height are always larger than the actual client area (in the samples, they are
usually 31,000). These values stop us from being able to properly re-size and
re-position controls on the form. What is the purpose behind these values? I realize that this is a very straightforward task we are
trying to accomplish, but we cannot seem to get it to work with Commandbars in
use. We’ve searched through the forums and have studied the documentation.
We’re lost. The package seems quite good, but the documentation is horrible! Can anyone offer any suggestions? Thanks in advance. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hello, CommandBars.GetClientRect doesn't decrease size of MDITabWorkspace. Think it can be reason of you problem... |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Eugene
Newbie Joined: 30 December 2005 Status: Offline Points: 3 |
Post Options
Thanks(0)
|
Hello,
I'm not trying to change the size of the MDITabworkspace. I am trying to re-size the MDI child form. In the samples provided with Commandbars, the MDI child form has Top, Left, Width, and Height set from within the Form_Load procedure. In your examples, these values seem arbitrary -- negative numbers are used for Top and Left and huge numbers (31,000) are used for Width and Height. I can't find anything in the documentation explaining why these values were used. I need to find out how to determine the size of the actual client area -- judging from the help files, that seems like what GetClientRect is supposed to do, but I am not getting proper values. For example, GetClientRect is returning the same values regardless of the resolution of the system. This is a mission-critical capability for us. If we can't get this addressed, we can't use Xtreme Pro! Thanks. Eugene. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hello, Have no any problems with it:
see this code: frmD.Show |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Eugene
Newbie Joined: 30 December 2005 Status: Offline Points: 3 |
Post Options
Thanks(0)
|
Excellent. Thank you very much for the help!
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |