Wrox Programmer Forums
|
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 December 14th, 2004, 06:47 PM
Registered User
 
Join Date: Nov 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Main menu function

I have a main menu in a parent form which calls multiple child forms in a windows application;

        Dim newMdiChild As New Form1
        newMdiChild.MdiParent = Me
        newMdiChild.Show()

        Dim newMdiChild As New Form2
        newMdiChild.MdiParent = Me
        newMdiChild.Show()

How can I pass the child form class name as a parameter to a function so that I can avoid the above code repetition?

Thanks

 
Old December 15th, 2004, 05:02 AM
Friend of Wrox
 
Join Date: Feb 2004
Posts: 177
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Why you want to pass the name of the child form, instead you pass in the form like below
SetMDIProperty(frm)

The function would be like SetMDIProperty(from as System.Windows.Forms)
and do all the work in the function.



It is not how much we do,
but how much love we put in the doing.

-Mother Theresa
 
Old December 15th, 2004, 06:48 PM
Registered User
 
Join Date: Nov 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It doesn't work. Can you pls explain by giving some example code.

Andy





Similar Threads
Thread Thread Starter Forum Replies Last Post
Anable/Disable main menu item problem Dmitriy Oracle 1 January 23rd, 2007 03:41 PM
Anable/Disable main menu item problem Dmitriy Oracle ASP 0 January 23rd, 2007 03:36 PM
Anable/Disable main menu item problem Dmitriy Ajax 0 January 23rd, 2007 03:29 PM
Anable/Disable main menu item problem Dmitriy Assembly Language 0 January 23rd, 2007 03:27 PM
Help with Main Menu GAF General .NET 0 March 18th, 2005 08:10 PM





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