Solved

MDI Client Area calculations

Posted on 2007-04-01
1
364 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Input past end of file vbs script 9 82
How to debug this code 7 56
VBA: Select SQL query based on a config Sheet v2 11 38
Advice in Xamarin 21 57
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

896 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

14 Experts available now in Live!

Get 1:1 Help Now