Solved

MDI Client Area calculations

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

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

808 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