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.
|