VB .NET Forms
Posted on 2004-10-10
My experience is with VB 6 and I have a question regarding VB .NET forms. How do I refer to public variables and functions that exist within a form from another form, an instance of which has been instantiated by this form? Simplified, I have a form frmMain which loads on application start. I have another for frmHelp. I have an event in frmMain which does:
dim frmHelp as New frmHelp
Now, how, from frmHelp, do I get the values of variables and call functions from the caller form, frmMain? In VB6, I could just do:
from frmHelp. Note that instantiating a new instance of frmMain within frmHelp is not an acceptable solution, given that I need access to variables whose default values have been changed.
Secondly, I need to make frmMain pause its activity until frmHelp has finished what it needs to do. In other words, frmMain should pull up frmHelp, then wait until frmHelp has been closed to continue with the remaining instructions in the event function of frmMain which called frmHelp.
I hope this is clear.