Solved

MDI Client Area calculations

Posted on 2007-04-01
1
361 Views
Last Modified: 2012-08-13
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
Comment
Question by:dwe0608
1 Comment
 
LVL 49

Accepted Solution

by:
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now