begginer

  • Thread starter Thread starter Tonya
  • Start date Start date
T

Tonya

Hi,

I have got 2 forms... frmHome and frmMain.
to open my frmMain from my frmHome i use the following code

Dim frmMain as new frmMain
frmMain.show

the problem is when i click a button to return me to my
homepage from frmMain a new instance of the homepage is
created rather than just opening the existing one that is
open.

how do i open the one that is currently open?
and how do i close the current form after the new one has
been opened?
 
You need to pass a reference from frmHome to frmMain, so you can re-use it.
For more info on forms, check out following article:
http://msdn.microsoft.com/library/e...ltipleformsinvisualbasicnetupgradingtonet.asp
Working with Multiple Forms in Visual Basic .NET: Upgrading to .NET
Duncan Mackenzie
Microsoft Developer Network

June 2002

Summary: Describes how working with multiple forms has changed from previous
editions of Microsoft Visual Basic and illustrates several key techniques,
including displaying a second form, changing the appearance of another form,
and using a form as a dialog. (8 printed pages)
 
Back
Top