Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 22nd, 2005, 07:27 PM
Registered User
 
Join Date: Jun 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to david29118 Send a message via MSN to david29118
Default Problem with loading MDI Child Forms.

Good evening everyone. I am wondering if someone can help me with a small problem I've been having with a MDI Application I'm in the process of developing.

I have the following structure so far:

1. MDI Parent: frmMain
2. MDI Child: frmWelcome

When the application loads the MDI Parent automatically loads the frmWelcome into the space provided for the child form.

In the settings of the frmWelcome i disabled the control box, border is set to none and the maximize / minimize buttons are set to false.

The problem i'm having is when the application loads the bar specifically for my parent form menu loads a second set of minimize / maximize / close buttons that belong to the child form. Also the child form is loading a bit cut off at the top. If i click the maximize button it then reloads the form properly and removes the buttons for the child form.

Below is the code found within my parent form for loading new mdi child forms into the application:

Load Form Code
    Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Loads Welcome Page At Runtime
        If CheckIfOpen("frmWelcome") = False Then
            Dim fv As New frmWelcome
            fv.MdiParent = Me
            fv.Show()
            fv.Dock = DockStyle.Fill
        End If
    End Sub

Check if open function (Prevents duplicate forms of being loaded) Private Function CheckIfOpen(ByVal frmName As String) As Boolean
        'Code used to prevent duplicate child forms from being opened ontop of eachother.
        Dim frm As Form
        For Each frm In Me.MdiChildren
            If frm.Name = frmName Then
                frm.Focus()
                Return True
                Exit Function
            End If
        Next
        Return False
    End Function

Menu Command For Loading the Start Page on click Private Sub mnuHelpWelcome_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuHelpWelcome.Click
        'Opens Welcome Page
        If CheckIfOpen("frmWelcome") = False Then
            Dim fv As New frmWelcome
            fv.MdiParent = Me
            fv.Show()
            fv.Dock = DockStyle.Fill
        End If
    End Sub

Thank you in advance for any help you can send my way that way I can get this resolved before I begin developing other forms in my application.

Thanks,
David Watson






Similar Threads
Thread Thread Starter Forum Replies Last Post
MDI & MDI Child Forms Menu's in VB2005 yulyos Visual Studio 2005 0 September 7th, 2007 09:49 AM
Opening MDI Child on Button Click of MDI Child Sachin Shinde Visual Studio 2005 0 June 8th, 2006 05:05 AM
Accessing the MDI form controls from child forms krishnasamaga Visual Studio 2005 1 June 7th, 2006 08:09 AM
closing mdi child forms kanoorani VB Databases Basics 1 May 31st, 2006 03:08 PM
MDI; other programs as child forms? Nick.Net VB.NET 2002/2003 Basics 0 November 28th, 2004 05:07 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.