Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide & bring back form

Status
Not open for further replies.

allanmc10

Programmer
Feb 23, 2006
39
GB
I am pressing a btn and showing a form but i want to hide the form the btn is on and when i close existing form, main form comes to the front.


Any ideas????


Cheers

big al
 
Hi,

I must say that by reading your post... i dont understand you. So, according to the title, i would suggest to search for 'singleton form'

Hope this helps
 
Al:

On form with button, paste this code behind the click event.

[code--Form1]

Visible=False

[/code]

Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.
 
Site keeps erroring:

Al:

On form with button, paste this code behind the click event.

[code--Form1]
SetMainForm=Me
Visible=False

[/code]

On 2nd Form, paste this code inside the Formevents.Closing event.

[Code--Form2.Closing]
FRM1=GetMainForm
FRM1.Visible=True
[/code]

Create a module and add the properties to Set and Get the Main Form

[Code--Module1]

Public FRM1 as Form1

Public WriteOnly Property SetForm() As Form1
Set(ByVal Value As Form1)
FRM1 = Value
End Set
End Property

Public ReadOnly Property GetForm() As Form1
Get
Return FRM1
End Get
End Property
[/code]

I hope this helps.


Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top