By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,343 Members | 925 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,343 IT Pros & Developers. It's quick & easy.

Reference an open form

P: n/a
I've been attempting to find out how this is accomplished in .NET,
because it appears to be far less simple then in 6. Essentially, I want to
be able to hide and display an existing form, instead of having to create a
new instance of the form everytime I need it. With VB 6 it was as simple as
form1.show and form1.hide, but in .NET, I'm at a loss; and I can never seem
to locate the information I need in the Library. Any pointers to where I
might find more information on the way forms are now handled would be
greatly appreciated.

- Jake G.
Nov 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Dim MyForm as New YourFormName

MyForm.show()
MyForm.hide()
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"J. Garrido" <no****@email.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I've been attempting to find out how this is accomplished in .NET,
because it appears to be far less simple then in 6. Essentially, I want to
be able to hide and display an existing form, instead of having to create a new instance of the form everytime I need it. With VB 6 it was as simple as form1.show and form1.hide, but in .NET, I'm at a loss; and I can never seem to locate the information I need in the Library. Any pointers to where I
might find more information on the way forms are now handled would be
greatly appreciated.

- Jake G.

Nov 20 '05 #2

P: n/a
Hi Terry, thanks for the quick reply, but the problem with that snippet
is that it will create a new instance everytime it is run. I need to
reference a pre-existing instance.

- JG
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:Oi**************@TK2MSFTNGP10.phx.gbl...
Dim MyForm as New YourFormName

MyForm.show()
MyForm.hide()
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"J. Garrido" <no****@email.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I've been attempting to find out how this is accomplished in .NET,
because it appears to be far less simple then in 6. Essentially, I want to be able to hide and display an existing form, instead of having to
create a
new instance of the form everytime I need it. With VB 6 it was as simple

as
form1.show and form1.hide, but in .NET, I'm at a loss; and I can never

seem
to locate the information I need in the Library. Any pointers to where I
might find more information on the way forms are now handled would be
greatly appreciated.

- Jake G.


Nov 20 '05 #3

P: n/a
Create the instance at class level, then you can call it from anywhere in
the form, alternatively, declare a sub main and use that to call your main
form and declare the ones you need.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"J. Garrido" <no****@email.com> wrote in message
news:ua**************@TK2MSFTNGP09.phx.gbl...
Hi Terry, thanks for the quick reply, but the problem with that snippet is that it will create a new instance everytime it is run. I need to
reference a pre-existing instance.

- JG
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message news:Oi**************@TK2MSFTNGP10.phx.gbl...
Dim MyForm as New YourFormName

MyForm.show()
MyForm.hide()
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"J. Garrido" <no****@email.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I've been attempting to find out how this is accomplished in .NET,
because it appears to be far less simple then in 6. Essentially, I want
to
be able to hide and display an existing form, instead of having to create
a
new instance of the form everytime I need it. With VB 6 it was as

simple as
form1.show and form1.hide, but in .NET, I'm at a loss; and I can never

seem
to locate the information I need in the Library. Any pointers to where

I might find more information on the way forms are now handled would be
greatly appreciated.

- Jake G.



Nov 20 '05 #4

P: n/a
* "J. Garrido" <no****@email.com> scripsit:
I've been attempting to find out how this is accomplished in .NET,
because it appears to be far less simple then in 6. Essentially, I want to
be able to hide and display an existing form, instead of having to create a
new instance of the form everytime I need it. With VB 6 it was as simple as
form1.show and form1.hide, but in .NET, I'm at a loss; and I can never seem
to locate the information I need in the Library. Any pointers to where I
might find more information on the way forms are now handled would be
greatly appreciated.


Google for the Singleton design pattern. By implementing this pattern,
you can access your form's default instances easily.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #5

P: n/a
Great! Thanks guys, I will look into both of those things.

- JG
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ul**************@TK2MSFTNGP11.phx.gbl...
* "J. Garrido" <no****@email.com> scripsit:
I've been attempting to find out how this is accomplished in .NET,
because it appears to be far less simple then in 6. Essentially, I want to be able to hide and display an existing form, instead of having to create a new instance of the form everytime I need it. With VB 6 it was as simple as form1.show and form1.hide, but in .NET, I'm at a loss; and I can never seem to locate the information I need in the Library. Any pointers to where I
might find more information on the way forms are now handled would be
greatly appreciated.


Google for the Singleton design pattern. By implementing this pattern,
you can access your form's default instances easily.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.