In VB6, you were able to refer to any form by the form-name (like Form1,
frmMain, etc) and you were also able to create multiple instances of any
form like:
Dim frm as New Form2
In VB.NET you cannot code against the form-name (the class) anymore. You
always have to create an instance of any form before using it. The new
problem here is that you cannot get a hold on any of the application's forms
(instances) unless you have a public variable referencing that form for you
to use (global data as you said).
One way of doing that is adding a Module to your app and declaring variables
to hold references to the form instances that you'll need across your app:
Module YourModule
Public mainForm as frmMain
Public clockForm as frmClock
End Module
In your code, when you open the main form for the first time, you store the
reference in the appropriate variable:
mainForm = New frmMain()
mainForm.Show()
Then you can use the variable mainForm anywhere else in your app to
manipulate the main form.
That's the idea.
HTH
--
TJoker, MCSD.NET
MVP: Paint, Notepad, Solitaire
****************************************
"CsProviders" <CS*********@yahoo.com> wrote in message
news:01****************************@phx.gbl...
i am a newbie to .net programming, i am having problem
with global data and form instanciation. My questions are
How do i maintain global data in windows forms
applications? How do i navigate from one form to another
form class? (example me.hide() and form2.show)
TIA
CSP