MDI and child forms change relative sizes on different PC/Monitors 
Author Message
 MDI and child forms change relative sizes on different PC/Monitors

How can I make my MDI & child forms keep their same relative sizes on
different computers/monitors?

My MDI child form is adjusted to fill the MDI area exactly when it is
loaded. It has an SSTab control on it. The child's width and height
are adjusted in form_load to fill the MDI area perfectly when run in
the VB6 environment and as an installed EXE. My PC monitor is a CRT:
1024 X 768

Then I install it on a different PC with an LCD 1280 X 1024 monitor.
On this monitor the child form is about 10% larger than the MDI area,
which brings up both horizontal and vertical scrollbars.

Additional information:
==== In MDIForm1_load
Me.Width = 8780
Me.Height = 6750
Me.MyDesignFormWidth = 8730
Me.MyDesignFormHeight = 6000

==== In the child form_load:
Width = MDIForm1.MyDesignFormWidth
Height = MDIForm1.MyDesignFormHeight

How can I make the MDI and child forms be the same relative size on
both monitors?

Information will be appreciated,
Stan Hilliard



Mon, 11 Jul 2011 08:52:08 GMT  
 MDI and child forms change relative sizes on different PC/Monitors
Hi Stan,

Isn't this as simple as setting the child to maximized ?
.WindowState = vbMaximized


Quote:
> How can I make my MDI & child forms keep their same relative sizes on
> different computers/monitors?

> My MDI child form is adjusted to fill the MDI area exactly when it is
> loaded. It has an SSTab control on it. The child's width and height
> are adjusted in form_load to fill the MDI area perfectly when run in
> the VB6 environment and as an installed EXE. My PC monitor is a CRT:
> 1024 X 768

> Then I install it on a different PC with an LCD 1280 X 1024 monitor.
> On this monitor the child form is about 10% larger than the MDI area,
> which brings up both horizontal and vertical scrollbars.

> Additional information:
> ==== In MDIForm1_load
> Me.Width = 8780
> Me.Height = 6750
> Me.MyDesignFormWidth = 8730
> Me.MyDesignFormHeight = 6000

> ==== In the child form_load:
> Width = MDIForm1.MyDesignFormWidth
> Height = MDIForm1.MyDesignFormHeight

> How can I make the MDI and child forms be the same relative size on
> both monitors?

> Information will be appreciated,
> Stan Hilliard



Mon, 11 Jul 2011 10:24:10 GMT  
 MDI and child forms change relative sizes on different PC/Monitors


Quote:
> How can I make my MDI & child forms keep their same relative sizes on
> different computers/monitors?

> Additional information:
> ==== In MDIForm1_load
> Me.Width = 8780
> Me.Height = 6750
> Me.MyDesignFormWidth = 8730
> Me.MyDesignFormHeight = 6000

> ==== In the child form_load:
> Width = MDIForm1.MyDesignFormWidth
> Height = MDIForm1.MyDesignFormHeight

> How can I make the MDI and child forms be the same relative size on
> both monitors?

You can't get away with hard-coding form sizes in twips. If the end user has
a different DPI setting, no matter what their resolution is, the sizes will
be all over the place.

For example, on my system, using Small fonts, this debug.print will produce
different results than it would if I were using Large or Custom font
settings.

?8780/screen.TwipsPerPixelX
 585.3333

Your form is 585.3333 pixels... there's really no use for fractions of a
pixel.

?screen.TwipsPerPixelX
 15

so... 39 (or 40) pixels makes more sense... so use:
MyWidth = 39 * Screen.TwipsPerPixelX 'etc

Try this on your existing project

'=======
Option Explicit

Private Sub Form_Load()
   With Me
      .Move 0, 0, MDIForm1.ScaleWidth, MDIForm1.ScaleHeight
   End With
End Sub
'=======



Mon, 11 Jul 2011 10:28:35 GMT  
 MDI and child forms change relative sizes on different PC/Monitors
On Wed, 21 Jan 2009 18:28:35 -0800, "Ken Halter"

Quote:



>> How can I make my MDI & child forms keep their same relative sizes on
>> different computers/monitors?

>> Additional information:
>> ==== In MDIForm1_load
>> Me.Width = 8780
>> Me.Height = 6750
>> Me.MyDesignFormWidth = 8730
>> Me.MyDesignFormHeight = 6000

>> ==== In the child form_load:
>> Width = MDIForm1.MyDesignFormWidth
>> Height = MDIForm1.MyDesignFormHeight

>> How can I make the MDI and child forms be the same relative size on
>> both monitors?

>You can't get away with hard-coding form sizes in twips. If the end user has
>a different DPI setting, no matter what their resolution is, the sizes will
>be all over the place.

>For example, on my system, using Small fonts, this debug.print will produce
>different results than it would if I were using Large or Custom font
>settings.

>?8780/screen.TwipsPerPixelX
> 585.3333

>Your form is 585.3333 pixels... there's really no use for fractions of a
>pixel.

>?screen.TwipsPerPixelX
> 15

>so... 39 (or 40) pixels makes more sense... so use:
>MyWidth = 39 * Screen.TwipsPerPixelX 'etc

>Try this on your existing project

>'=======
>Option Explicit

>Private Sub Form_Load()
>   With Me
>      .Move 0, 0, MDIForm1.ScaleWidth, MDIForm1.ScaleHeight
>   End With
>End Sub
>'=======

I tried replacing my code with:

   With Me
      .Move 0, 0, MDIForm1.ScaleWidth, MDIForm1.ScaleHeight
   End With

and it worked on the PC that I was working on but on the other PC the
results are as before -- the child too big for the parent, or the
parent too small to hold the child. I would have expected both forms
to be "distorted" in the same geometric way. Why wouldn't that happen?

I don't understand what you are suggesting I do with:

Quote:
>so... 39 (or 40) pixels makes more sense... so use:
>MyWidth = 39 * Screen.TwipsPerPixelX 'etc

Would you please say more about that?

The child form has ScaleMode set to 1 - Twip. The MDI form does not
show a scalemode property. Could it be that a mismatch here causes the
two forms to scale themselves differently on my two different
computers. (My goal is that the two forms scale similar to each other
on any computer.)

I am confused,
Stan Hilliard



Mon, 11 Jul 2011 11:46:28 GMT  
 MDI and child forms change relative sizes on different PC/Monitors
I want the user to be able to optionally enlarge the MDI without
changing the size of the child -- after the originally opening that
first child form. There will other child forms that will end up in the
same MDI.

Perhaps I should try to open the child as vbMaximized, record its
height and width, set it to vbNormal, and use Move to keep it where it
belongs.
Stan

On Thu, 22 Jan 2009 13:24:10 +1100, "Bill McCarthy" <TPASoft.com Are

Quote:

>Hi Stan,
>Isn't this as simple as setting the child to maximized ?
>.WindowState = vbMaximized



>> How can I make my MDI & child forms keep their same relative sizes on
>> different computers/monitors?

>> My MDI child form is adjusted to fill the MDI area exactly when it is
>> loaded. It has an SSTab control on it. The child's width and height
>> are adjusted in form_load to fill the MDI area perfectly when run in
>> the VB6 environment and as an installed EXE. My PC monitor is a CRT:
>> 1024 X 768

>> Then I install it on a different PC with an LCD 1280 X 1024 monitor.
>> On this monitor the child form is about 10% larger than the MDI area,
>> which brings up both horizontal and vertical scrollbars.

>> Additional information:
>> ==== In MDIForm1_load
>> Me.Width = 8780
>> Me.Height = 6750
>> Me.MyDesignFormWidth = 8730
>> Me.MyDesignFormHeight = 6000

>> ==== In the child form_load:
>> Width = MDIForm1.MyDesignFormWidth
>> Height = MDIForm1.MyDesignFormHeight

>> How can I make the MDI and child forms be the same relative size on
>> both monitors?

>> Information will be appreciated,
>> Stan Hilliard



Mon, 11 Jul 2011 11:56:51 GMT  
 MDI and child forms change relative sizes on different PC/Monitors

Quote:
>I want the user to be able to optionally enlarge the MDI without
> changing the size of the child -- after the originally opening that
> first child form. There will other child forms that will end up in the
> same MDI.

> Perhaps I should try to open the child as vbMaximized, record its
> height and width, set it to vbNormal, and use Move to keep it where it
> belongs.

This may not be the best solution, but try calling GetClientRect(MDIhWnd).


Mon, 11 Jul 2011 12:43:02 GMT  
 MDI and child forms change relative sizes on different PC/Monitors

Quote:

> and it worked on the PC that I was working on but on the other PC the
> results are as before -- the child too big for the parent, or the
> parent too small to hold the child. I would have expected both forms
> to be "distorted" in the same geometric way. Why wouldn't that happen?

Which OS? Vista tends to throw curve balls, when it comes to the size of
objects on screen.

Quote:
> I don't understand what you are suggesting I do with:
>>so... 39 (or 40) pixels makes more sense... so use:
>>MyWidth = 39 * Screen.TwipsPerPixelX 'etc
> Would you please say more about that?

Way back when VB was born <g> a forms coordinate system was designed to
match a printer. Printers (at that time, anyway) used Twips, 1440 per
inch... so, VB's native coordinates were specified in Twips as well. They
were supposed to look the same on paper as they did on the screen.

Screen.TwipsPerPixelX (and TwipsPerPixelY) were introduced as a way to
convert twips to pixels on the screen. I imagine calculations that don't
round perfectly are "fudged" to the nearest pixel, which may be up to 15
twips larger on some systems (Small Fonts), 12 twips on others (Large Fonts)
and "who knows what" on systems using "Custom Fonts" or a custom DPI
setting.

Here's a sample using expvb's GetClientRect suggestion. I don't have
multiple systems to try it on right now, but it's worth a shot. I set the
child to Pixels and the parent is naturally twips. If you take a look at the
form's size in the property window, you'll see it's in twips, regardless of
the coordinate system you choose. Most controls you drop on the form will
reflect the selected (Pixel) coordinate system (clear as mud?)
'=============
Option Explicit

Private Declare Function GetClientRect _
   Lib "user32.dll" (ByVal hwnd As Long, ByRef lpRect As RECT) As Long

Private Declare Function GetWindow Lib "user32" _
   (ByVal hwnd As Long, ByVal wCmd As Long) As Long

Private Type RECT
   Left As Long
   Top As Long
   Right As Long
   Bottom As Long
End Type

Private Sub Form_Load()
   Const GW_CHILD = 5
   Dim lMDIParent As Long
   Dim tParent As RECT

   'an MDI parent form has an "inner child" so...
   lMDIParent = GetWindow(MDIForm1.hwnd, GW_CHILD)

   'get it's client area
   Call GetClientRect(lMDIParent, tParent)

   'tParent should contain the size of the client area for that MDI form
   'It's specified in Pixels, though, so they need to be converted to twips
(gotta love it)
   Me.Move 0, 0, tParent.Right * Screen.TwipsPerPixelX _
      , tParent.Bottom * Screen.TwipsPerPixelY

End Sub
'=============



Mon, 11 Jul 2011 14:09:50 GMT  
 MDI and child forms change relative sizes on different PC/Monitors

Quote:
> How can I make my MDI & child forms keep their same
> relative sizes on different computers/monitors? My MDI
> child form is adjusted to fill the MDI area exactly when it
> is loaded. It has an SSTab control on it. The child's width
> and height are adjusted in form_load to fill the MDI area
> perfectly when run in the VB6 environment and as an
> installed EXE. My PC monitor is a CRT: 1024 X 768
> Then I install it on a different PC with an LCD
> 1280 X 1024 monitor. On this monitor the child form is
> about 10% larger than the MDI area, which brings up
> both horizontal and vertical scrollbars.

For Forms of such a small size as yours (8780 x 6750 twips) the difference
in screen pixel area (1024 x 768, 1280 x 1024, etc) is itself unlikely to
cause any problems regarding the initial display size of the Form unless on
the target machine the screen pixel area is extremely small (less than 800 x
600 pixels) or the dpi resolution is extremely large (more than 120 pixels
per logical inch). However, other things can affect the relative sizes, even
with small Forms, and in general you should take such things into account in
your code. For example, you shouldn't really set a Form's Width or Height to
a specific value without first checking (in your code) that there is
sufficient space on the display, or at the very least checking the values
after you have set them to ensure that they are actually what you set them
to. Neither should you hard code any values which assume that a Form's
borders or caption bar are a specific size, because such things are likely
to be a different thickness on different machines. Your problem, with the
code as you have shown it, may be down to the target machine running at a
different pixels per logical inch setting or it may simply be that the
borders are a different thickness anyway on that machine, even if it is
running at the same pixels per logical inch setting. I don't usually use MDI
Forms myself, and I know they behave slightly different than a SDI Form in
various ways with respect to things like Status Bars etc, but you should be
able to get the initial conditions right on all machines (at least with your
initial 8780 x 6750 twip main Form size) by setting the child Form so that
it fills the available ScaleWidth and ScaleHeight. To do it correctly you
need to make sure that the main Form is fully shown before loading and
sizing the child Form, and a Me.Show in the main Form's Load event should do
this for you. You haven't said anything about the code you may have in the
various Resize events, but assumning you are not doing anything wrong there
then you should get the initial display conditions correct by doing
something like:

    ==== In MDIForm1_load
    Me.Width = 8780
    Me.Height = 6750
    Me.Show
    ' now load the child Form

    ==== In the child form_load:
    Width = MDIForm1.ScaleWidth
    Height = MDIForm1.ScaleHeight

If that doesn't work then temporarily remove all code from both Resize
events, and possibly both Paint events depending on what you've got in
there, (code which you haven't yet shown us) and try it again.

Mike



Mon, 11 Jul 2011 19:02:21 GMT  
 MDI and child forms change relative sizes on different PC/Monitors
I'm working for many years on MDI application and have the same requirements
as yours.
In order to keep all forms and controls relatively or approximately the same
size I do resizing in many places.
First of all I have Public Sub GetMultiplier()
    If intWidth > 11980 And intWidth < 12020 And intHeight > 8980 And
intHeight < 9020 Then '800X600, Width 12000, Height 9000 as standard values
        intScreenResolution = 1
    ElseIf intWidth > 15340 And intWidth < 15380 And intHeight > 11500 And
intHeight < 11540 Then '1024X768, 15360X11520
        intScreenResolution = 2
    ElseIf intWidth > 17260 And intWidth < 17300 And intHeight > 12940 And
intHeight < 12980 Then '1152X864, 17280X12960
        intScreenResolution = 3
    ElseIf intWidth > 19180 And intWidth < 19220 And intHeight > 15340 And
intHeight < 15380 Then '1280X1024,19200X15360
        intScreenResolution = 4
.......
and so on for all known by me resolutions
Then I do this:
    Select Case intScreenResolution
        Case 0
            sngSizeMultiplierHor = 1 'Unknown resolution
            sngSizeFixerHor = 1
            sngSizeFixerVert = 1
        Case 1
        'Bad
            sngSizeMultiplierHor = 1 '800X600
            sngSizeFixerHor = 0.78005
            sngSizeFixerVert = 0.78125
        Case 2
            sngSizeMultiplierHor = 1.28
            sngSizeFixerHor = 1
            sngSizeFixerVert = 1
        Case 3
            sngSizeMultiplierHor = 1.44 '1152X864
            sngSizeFixerHor = 1.123
            sngSizeFixerVert = 1.12
        Case 4
            sngSizeMultiplierHor = 1.6 '1280X1024
            sngSizeFixerHor = 1.24
            sngSizeFixerVert = 1.35

And so on...
Then I use
Public Sub SizeFixer(frm As Form)
Dim ctr As Control
Dim intCounter As Integer
Dim CtlCln As New Collection
    On Error Resume Next
    frm.Width = frm.Width * sngSizeFixerHor
    frm.Height = frm.Height * sngSizeFixerVert
    frm.FontSize = frm.FontSize * sngSizeFixerVert
    frm.Font = "Arial"
    For Each ctr In frm.Controls
        If ctr.name <> "imgQuickBooksConnected" And ctr.name <>
"ctListBarMain" Then
            ctr.Width = ctr.Width * sngSizeFixerHor
            ctr.Height = ctr.Height * sngSizeFixerVert
            ctr.Left = ctr.Left * sngSizeFixerHor
            ctr.Top = ctr.Top * sngSizeFixerVert
        End If
        If (TypeOf ctr Is TextBox) Or (TypeOf ctr Is Label) Or _
            (TypeOf ctr Is CommandButton) Or (TypeOf ctr Is ComboBox) Or _
            (TypeOf ctr Is ListBox) Or (TypeOf ctr Is DriveListBox) Or _
            (TypeOf ctr Is DirListBox) Or (TypeOf ctr Is FileListBox) Or _
            (TypeOf ctr Is MaskEdBox) Or (TypeOf ctr Is SSDBCombo) Or _
            (TypeOf ctr Is SSDBDropDown) Or _
            (TypeOf ctr Is SSFrame) Or _
            (TypeOf ctr Is SSPanel) Or (TypeOf ctr Is SSOption) Or _
            (TypeOf ctr Is SSCheck) Or (TypeOf ctr Is SSDBGrid) Or _
            (TypeOf ctr Is ctDropDate) Or _
            (TypeOf ctr Is ctButton) Or _
            (TypeOf ctr Is CommonDialog) Or _
            (TypeOf ctr Is Menu) Or (TypeOf ctr Is StatusBar) Or _
            (TypeOf ctr Is Frame) Or (TypeOf ctr Is OptionButton) Or _
            (TypeOf ctr Is ctListBar) Or (TypeOf ctr Is CheckBox) Then
                ctr.Font = "Arial"
                ctr.Font.Size = ctr.Font.Size * sngSizeFixerVert
        End If
        If (TypeOf ctr Is ctDropDate) Then
            ctr.CalWidth = ctr.CalWidth * sngSizeFixerVert
            ctr.CalFont = "Arial"
            ctr.CalFont.Size = ctr.CalFont.Size * sngSizeFixerVert
            ctr.CalHeight = ctr.CalHeight * sngSizeFixerVert
            ctr.CalTitleFont = "Arial"
            ctr.CalTitleFont.Size = ctr.CalTitleFont.Size * sngSizeFixerVert
        End If

I continue with all other controls which have unstandard properties.

I call this Sub on Form_Load event of each form.

I couldn't find any easier approach within many years. I tested many resize
third party tools. No one worked fine for all my controls. So I decided to
go with my own (probably not the best one) approach.

vovan


Quote:
> How can I make my MDI & child forms keep their same relative sizes on
> different computers/monitors?

> My MDI child form is adjusted to fill the MDI area exactly when it is
> loaded. It has an SSTab control on it. The child's width and height
> are adjusted in form_load to fill the MDI area perfectly when run in
> the VB6 environment and as an installed EXE. My PC monitor is a CRT:
> 1024 X 768

> Then I install it on a different PC with an LCD 1280 X 1024 monitor.
> On this monitor the child form is about 10% larger than the MDI area,
> which brings up both horizontal and vertical scrollbars.

> Additional information:
> ==== In MDIForm1_load
> Me.Width = 8780
> Me.Height = 6750
> Me.MyDesignFormWidth = 8730
> Me.MyDesignFormHeight = 6000

> ==== In the child form_load:
> Width = MDIForm1.MyDesignFormWidth
> Height = MDIForm1.MyDesignFormHeight

> How can I make the MDI and child forms be the same relative size on
> both monitors?

> Information will be appreciated,
> Stan Hilliard



Tue, 12 Jul 2011 04:56:46 GMT  
 MDI and child forms change relative sizes on different PC/Monitors
hi Stan,

Okay if you don't want to maximize that form, then positioning it such as
Me.Move 0 , 0 , frmMDI.ScaleWidth, frmMDI.ScaleHeight
should do the job.  Check to make sure the MDI form is acutally fully
loaded, and if you are setting it's size from settings, make sure you have
applied those settings first.  And perhaps also check window state .  The
values you want are ScaleWdith and ScaleHieght of the mdi parent.


Quote:
>I want the user to be able to optionally enlarge the MDI without
> changing the size of the child -- after the originally opening that
> first child form. There will other child forms that will end up in the
> same MDI.

> Perhaps I should try to open the child as vbMaximized, record its
> height and width, set it to vbNormal, and use Move to keep it where it
> belongs.
> Stan

> On Thu, 22 Jan 2009 13:24:10 +1100, "Bill McCarthy" <TPASoft.com Are

>>Hi Stan,
>>Isn't this as simple as setting the child to maximized ?
>>.WindowState = vbMaximized



>>> How can I make my MDI & child forms keep their same relative sizes on
>>> different computers/monitors?

>>> My MDI child form is adjusted to fill the MDI area exactly when it is
>>> loaded. It has an SSTab control on it. The child's width and height
>>> are adjusted in form_load to fill the MDI area perfectly when run in
>>> the VB6 environment and as an installed EXE. My PC monitor is a CRT:
>>> 1024 X 768

>>> Then I install it on a different PC with an LCD 1280 X 1024 monitor.
>>> On this monitor the child form is about 10% larger than the MDI area,
>>> which brings up both horizontal and vertical scrollbars.

>>> Additional information:
>>> ==== In MDIForm1_load
>>> Me.Width = 8780
>>> Me.Height = 6750
>>> Me.MyDesignFormWidth = 8730
>>> Me.MyDesignFormHeight = 6000

>>> ==== In the child form_load:
>>> Width = MDIForm1.MyDesignFormWidth
>>> Height = MDIForm1.MyDesignFormHeight

>>> How can I make the MDI and child forms be the same relative size on
>>> both monitors?

>>> Information will be appreciated,
>>> Stan Hilliard



Tue, 12 Jul 2011 09:43:26 GMT  
 MDI and child forms change relative sizes on different PC/Monitors
On Wed, 21 Jan 2009 18:52:08 -0600, Stan Hilliard

Quote:

>How can I make my MDI & child forms keep their same relative sizes on
>different computers/monitors?

>My MDI child form is adjusted to fill the MDI area exactly when it is
>loaded. It has an SSTab control on it. The child's width and height
>are adjusted in form_load to fill the MDI area perfectly when run in
>the VB6 environment and as an installed EXE. My PC monitor is a CRT:
>1024 X 768

>Then I install it on a different PC with an LCD 1280 X 1024 monitor.
>On this monitor the child form is about 10% larger than the MDI area,
>which brings up both horizontal and vertical scrollbars.

>Additional information:
>==== In MDIForm1_load
>Me.Width = 8780
>Me.Height = 6750
>Me.MyDesignFormWidth = 8730
>Me.MyDesignFormHeight = 6000

>==== In the child form_load:
>Width = MDIForm1.MyDesignFormWidth
>Height = MDIForm1.MyDesignFormHeight

>How can I make the MDI and child forms be the same relative size on
>both monitors?

>Information will be appreciated,
>Stan Hilliard

I have considered the various suggestions and I think I have at least
partial success. Here are answers some of the questions about my
setup:

My 1024 X 768 CRT, where I write code, is running Windows 98SE.
The 1280 X 1024 LCD is driven by Windows XP Pro.

The MDI is always fully loaded before loading a child form, which is
initiated from a menu on the MDI.

I simplified the problem by starting a new test project with an
MDIForm1 and Form1. As I said earlier, the following code worked on
the 98SE/CRT PC but on the XP/CRT PC both the V & H scroll bars come
out upon loading the child form.

So far the following code seems to work the almost the way I want in
the simple test project but there is some specific interference in my
main program that I have to track down. Here is the code that works:

'==== Form1 (child) code.
Option Explicit
Private Sub Form_Load()
    Dim RatioW
    Dim RatioH

    With Me
        '==== resize this child to fit in the MDI.
        .Move 0, 0, MDIForm1.ScaleWidth, MDIForm1.ScaleHeight

        '==== resize the MDI to include the whole child horizontally.
        RatioW = MDIForm1.Width / MDIForm1.ScaleWidth
        MDIForm1.Width = Me.Width * RatioW

        '==== resize the MDI to include the whole child vertically.
        RatioH = MDIForm1.Height / MDIForm1.ScaleHeight
        MDIForm1.Height = Me.Height * RatioH
    End With
End Sub

'====  MDIForm1 code.
Option Explicit
Dim Loading As Boolean
Private Sub MDIForm_Load()
    '==== this controls the initial size of everything.
    Loading = True
    Me.Width = 8930
    Me.Height = 6750
    Me.Top = (Screen.Height - Me.Height) / 2
    Me.Left = (Screen.Width - Me.Width) / 2
    Loading = False
End Sub

Private Sub MDIForm_Resize()
    '==== execution goes here after any sizing and after form_load.
    If Loading Then Exit Sub
    '==== keep child form centered on screen.
    With Form1
        .WindowState = vbNormal
        .Top = 0
        .Left = (Me.ScaleWidth - .Width) / 2
    End With
End Sub

Private Sub mnuLoad_Click()
    '==== start child form from a menu on MDI.
    Form1.Show
End Sub

This code solves my initial problem. The child form of the test
project loads and fills the MDI scale area fully and without invoking
the scroll bars -- regardless of which computer it is running on.

Stan Hilliard



Sun, 17 Jul 2011 14:37:35 GMT  
 MDI and child forms change relative sizes on different PC/Monitors
On Wed, 28 Jan 2009 00:37:35 -0600, Stan Hilliard

Quote:

>This code solves my initial problem. The child form of the test
>project loads and fills the MDI scale area fully and without invoking
>the scroll bars -- regardless of which computer it is running on.
>Stan Hilliard

But there is still a puzzle.

I can load the child form and it fills the MDI's scale area completely
and without toolbars. But then, if I make the MDI form slightly less
wide, the horizontal scroll bar appears (as expected) but the vertical
scrollbar also appears (as not expected). The vertical scrollbar
doesn't go away until I widen the MDI form one scrollbar width beyond
where it was originally. At the point where the scrollbar finally
vanishes, a space exists between the child and MDI the width of the
scrollbar.

The same sort of thing happens when I reduce the height of the MDI.

I have not tried the GetClientRect function yet but I doubt that would
prevent this weird scrollbar behavior because it happens when resizing
the MDI form manually.

At least, it happens on both computers the same way.
Stan Hilliard



Sun, 17 Jul 2011 14:44:11 GMT  
 
 [ 12 post ] 

 Relevant Pages 

1. Q: Form activate Fires On Non Child MDI Forms But Only Once On Child Mdi Forms

2. MDI Child Forms Changing Size??

3. MDI Child form size changed when BorderStyle = 2 (sizable)

4. MDI Child form size changed when BorderStyle = 2 (sizable)

5. Form Size and different sized monitors in VB4.0

6. Picture size on Form for different monitor size

7. Sizing forms for users with different monitor size

8. MDI form and MDI Child in different projects

9. MDI form and MDI Child in different projects

10. Help: Change a MDI child's parent MDI form at run-time

11. question about mdi forms and the size of their child forms

12. Form Size and Different Monitors

 

 
Powered by phpBB® Forum Software