Re: Form Reference Question (Getting Back Your Visual Basic 6.0 Goodies)
- From: "Gerry~Lowry" <gerry.lowry@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 3 Aug 2005 15:01:20 -0400
| As long as myModuleCode has a reference to "Form1" then you can do this.
| You'll probably have to send in a reference to form1 to form2.
| Something like:
|
| public class form2
| dim RefToForm1 as Form1
| sub new(F1 as Form1)
| mybase.new()
| RefToForm1 = F1
| end sub
| sub myModuleCode()
| RefToForm1.Visible = False
| .....
| RefToForm1.Visible = False
| end sub
| End class
|
| note that this way of doing it causes you to create Form2 this way:
|
| From inside Form1 somewhere...
| dim F2 as new Form2(Me) 'This passes in the reference of form1 to form2
|
| Hope it helps
| Chris
Hi, Chris ... it may help ... although I sense potential problems in more complex programs ...
For example, Form1 opens Form2, Form2 calls the sub "chris" in Module1, "chris" hides Form1,
then, later, Form1 opens Form3, Form3 calls the sub "chris" in Module1, "chris" hides Form1.
This all appears to force far to much form to form to module or class communication.
Since ALL of these code units are compiled together, it would be so much
easier if one could say from ANYWHERE, in a simple syntax, something like
"Form1".Visible = <truth value>
It would have been so much easier if VB.NET had included the VB6 Forms collection.
g.
.
- Follow-Ups:
- References:
- Form Reference Question (Getting Back Your Visual Basic 6.0 Goodies)
- From: gerryLowry::Ability Business Computer Services {KCAZ0H1}
- Re: Form Reference Question (Getting Back Your Visual Basic 6.0 Goodies)
- From: Chris
- Form Reference Question (Getting Back Your Visual Basic 6.0 Goodies)
- Prev by Date: Re: String in VB
- Next by Date: Re: Lies the documentation told me
- Previous by thread: Re: Form Reference Question (Getting Back Your Visual Basic 6.0 Goodies)
- Next by thread: Re: Form Reference Question (Getting Back Your Visual Basic 6.0 Goodies)
- Index(es):
Relevant Pages
|