|
-
Feb 3rd, 2003, 07:37 AM
#1
Thread Starter
Fanatic Member
MDI - variable scope
Hi
Im new to VB.NET and to be honest, not used MDI much in VB either.
My Application will consist of several forms, and I thought it be best to put them all into a MDI form.
There will only be one instance of each form, and I would like to know how I can show another form from within another.
In my MDI container form, I declared at the top, the form variables I would like to use
VB Code:
'-- Declaration section of MDI Container
Public formWelcome As New WelcomeForm()
Public formAddCD As New AddCDForm()
so I can access those variables anywhere in my MDI container.
How can I show and manipulate formAddCD from formWelcome?
the following doesn't work, vb.net can't find the variable formAddCD
VB Code:
'-- Inside WelcomeForm
Private Sub WelcomeForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
MdiMain.formAddCD.Show()
End Sub
Thanks
-
Feb 3rd, 2003, 07:45 AM
#2
Thread Starter
Fanatic Member
I done it, i moved the two form declarations to a Module.
but still, is there a way I can do it without a module?
-
Feb 3rd, 2003, 09:21 AM
#3
Sleep mode
Originally posted by Geespot
I done it, i moved the two form declarations to a Module.
but still, is there a way I can do it without a module?
you can use either ways , in a module or in a class .Storing your variable in a module is a good idea .It will be public to other forms in your proj.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|