Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / April 2005

Tip: Looking for answers? Try searching our database.

Help - Assigning MDI Child to MDI Container when called in a Modul

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Leo - 06 Apr 2005 14:53 GMT
I am trying to figure out how to assign the child form to the mdi container,
in VB, when the child is called from a module and not from the container form.

I know when called from the container form it is just:
dim form1 as new form1
form1.MDIParent = me  (being the container form)

but this does not work when you do this in a module.

Thanks

Leo
Christof Nordiek - 06 Apr 2005 16:21 GMT
Hi Leo,

the module has to know wich shall be the MDIParent.
There are two options:
1. Their is a shared variable (or a variable in a module) that is assignd
the parent.
This would be the best option if there is one MDIParent in your app, wich
most probably is true.

2. The method puting the form in the container has a parameter wich is the
MDIParent.
Then the caller has do know, which form shall be the MDIParent.

>I am trying to figure out how to assign the child form to the mdi
>container,
[quoted text clipped - 10 lines]
>
> Leo
Leo - 06 Apr 2005 17:15 GMT
Thanks for the help.  I used suggestion 1.  I created a public variable and
assigned the mdi container (MDIFORM1) to it on program start.
Public mdi as Form
mdi = Me

Then in the code mudule it became simple:
Dim fm as new Form1
fm.MDIParent = mdi

It works.

Thanks

Leo

> Hi Leo,
>
[quoted text clipped - 23 lines]
> >
> > Leo

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.