otherside Posted March 29, 2003 Posted March 29, 2003 Does anyone have a good knowledge of MDI ? Here is a question: When i need to open a new form in a parent form i use this line Assume parent form is Form1 sub button_click (button in Form1) Dim fo As New Form2 fo.MdiParent = Me fo.show I can do this when i'm creating the new instance of Form2 whithin the parent Form. When i need to create the instance of Form2 and set to it that the parent will be Form1, from a module or another Form, how can i do that ? Ex. Module Module1 public sub openform Dim fo As New Form2 fo.MDIParent = ????? fo.show Note: Form1 is the starting Form so no instance is being set. Quote
Moderators Robby Posted March 29, 2003 Moderators Posted March 29, 2003 If you really want to use a Module, then declare the fo as Public, Quote Visit...Bassic Software
*Gurus* divil Posted March 29, 2003 *Gurus* Posted March 29, 2003 Use a shared field on Form1 to store the one instance that is created, you can set it in the constructor or anywhere. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.