G
gerryLowry::Ability Business Computer Services {KC
"Getting Back Your Visual Basic 6.0 Goodies" by Billy Hollis, 2003-5-14,
states:
"Getting a Forms Collection
Visual Basic 6.0 developers are often fond of looping through the currently
loaded forms in an application to find out something, such as if a
particular form it loaded, or how many of a particular type of form are
loaded. Windows Forms does not include a Forms collection, however, so
gaining such functionality in Visual Basic .NET means some additional work."
Hollis gives an example were we have "Form1" and "Form2".
Form1 has TWO buttons ... the first button creates a number of instances
of Form2;
the second button uses a collection to make each instance of Form2
invisible.
PROBLEM
The above is like a FORWARD reference ... from the main form, to some other
form.
I am struggling with reversing the syntax ...
from other forms and other modules I would like to control Form1 ....
for example, when the end user clicks my control [some button] on Form2
which starts a routine myModuleCode, it would be nice if, in myModuleCode,
I could do something like:
....
"Form1".Visible = False ' Hide Form1 until processing is complete
.... ' start of processing
....
....
.... ' end of processing
"Form1".Visible = True ' Unhide Form1 because processing is
complete
....
My feeble attempts to adapt Hollis' example has only succeeded in causing a
variety of crashes. Using "Me", "Me.Name", et cetera, did not help me
discover the correct syntax.
Needless to say, the online help was useless (or perhaps it is I who is
useless at locating information just beyond my fingertips).
Rather than continuing to bang my brain against the syntax wall, I hope some
reader of this newsgroup will be kind enough to share her/his expertise in
this matter.
Thank you .... regards, gerry
states:
"Getting a Forms Collection
Visual Basic 6.0 developers are often fond of looping through the currently
loaded forms in an application to find out something, such as if a
particular form it loaded, or how many of a particular type of form are
loaded. Windows Forms does not include a Forms collection, however, so
gaining such functionality in Visual Basic .NET means some additional work."
Hollis gives an example were we have "Form1" and "Form2".
Form1 has TWO buttons ... the first button creates a number of instances
of Form2;
the second button uses a collection to make each instance of Form2
invisible.
PROBLEM
The above is like a FORWARD reference ... from the main form, to some other
form.
I am struggling with reversing the syntax ...
from other forms and other modules I would like to control Form1 ....
for example, when the end user clicks my control [some button] on Form2
which starts a routine myModuleCode, it would be nice if, in myModuleCode,
I could do something like:
....
"Form1".Visible = False ' Hide Form1 until processing is complete
.... ' start of processing
....
....
.... ' end of processing
"Form1".Visible = True ' Unhide Form1 because processing is
complete
....
My feeble attempts to adapt Hollis' example has only succeeded in causing a
variety of crashes. Using "Me", "Me.Name", et cetera, did not help me
discover the correct syntax.
Needless to say, the online help was useless (or perhaps it is I who is
useless at locating information just beyond my fingertips).
Rather than continuing to bang my brain against the syntax wall, I hope some
reader of this newsgroup will be kind enough to share her/his expertise in
this matter.
Thank you .... regards, gerry