j00ls code does the trick, but it's worth explaining.
In .NET everything you work with is an object. So, when you add a form to
your project what you are creating is a class containing code that defines
the look, feel and behaviour of the form. To load the form then, you have to
instantiate the class. It's the same as if I'd defined a class called Pete
and wanted an object from it
Dim myPete as New Pete()
That turns my Pete class into an object. So, if you have a form class called
Form2 (as in J00ls code) you'll need to first turn that class into an object
Dim myForm as new Form2()
Then, having turned it into an object, you can go ahead and call methods on
it, like Show()
myForm.Show()
Hope that makes sense. Take a look at the programming with objects guides in
the online help for more info on how to do OO with VB.NET. It's weird at
first when you move across from VB6, but ultimately it makes a lot more
sense than the old VB6 way of doing things.
--
Pete Wright
Author of ADO.NET Novice to Pro for Apress
www.petewright.org
"Michael Erlewine" <mi*****@erlewine.net> wrote in message
news:BQ******************@fe06.lga...
I am trying to learn VB.Net and can't figure out how to call a from from
another form. In VB6, I just issue a Load FormX, and an Unload FormX... and
Show the form and there it is.
I am sure it is obvious, but I can't see how to do that in VB.net. Does
someone have a piece of code that will call a from from another form and
have it appear.
Thanks,
Michael Erlewine
mi*****@erlewine.ent