Solved

# MDI Client Area calculations

Posted on 2007-04-01
374 Views
in vb6 (sp6) I have an MDI window which has a left aligned control  - the control is fixed and does not vary in width, how can I calculate the remaining area of the client (so I can create an mdi child window which is 50pix smaller than in width and height)

MTIA

Darrin
0
Question by:dwe0608
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
1 Comment

LVL 52

Accepted Solution

Ryan Chong earned 500 total points
ID: 18834191
try something like:

Private Sub mCenterActiveWindow_Click()

offSetWidth = 0
offSetHeight = 0

If Not Me.ActiveForm Is Nothing Then
If Not Me.ActiveForm.WindowState = vbNormal Then Me.ActiveForm.WindowState = vbNormal
Me.ActiveForm.Left = 0
Me.ActiveForm.Top = 0
Me.ActiveForm.Width = Me.Width - IIf(LeftPanelControl.Visible, LeftPanelControl.Width, 0) - offSetWidth
Me.ActiveForm.Height = Me.Height - IIf(LeftPanelControl.Visible, LeftPanelControl.Height, 0) - offSetHeight
End If
End Sub

hope this helps
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
###### Suggested Courses
Course of the Month3 days, 14 hours left to enroll