Size an mdi form with ismdicontainer property true and child form regardless of screen resolution

Hello Experts,
I have to size an mdi form (800*600 pixel) with ismdicontainer property true and child form regardless of screen resolution, so that the child form are contained in the mdi form without the scroll bars in the mdi form.
If I change resolution or the format of charater from 96 dpi to 120 dpi the scroll bar appear in the mdi form,
how can I resize the child form so that the the scroll bar do not appear also if I change screen resolution?

Another question: how can I set the backcolor of the mdi form, it is also dark grey also if I set a different color, from example green?

Thanks at all for help
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Fernando SotoRetiredCommented:
Hi aldog1;

Let me take the easy question first. In order to change the BackColor of the MDI container you need to get a reference to the control that Microsoft places there and that is not available at design time. To change the BackColor of the MDI container see sample code below.

    Private Sub Form1_Load(ByVal sender As System.Object, _
        ByVal e As System.EventArgs) Handles MyBase.Load
        For Each ctl As Control In Me.Controls
            If ctl.GetType Is GetType(MdiClient) Then
                Dim mdi As MdiClient = CType(ctl, MdiClient)
                mdi.BackColor = Color.Green
            End If
    End Sub

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Fernando SotoRetiredCommented:
As far as the first part of the question you can use the Form.ReSize event to resize the child mdi's on the form by using the Form.ClientSize to get the available space on the form.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.