Hi,

I'm using the following code to show and hide a form...

I'm showing form2 by clicking a button in form1 and again showing the form1 by clicking a buttin in form2...

I'm not closing ant of the form..i just hide it...
but i couldn't keep the inputs of Form2...don't know why????





VB Code:
  1. In form1 button click
  2. --------------------------
  3.  
  4. Dim nf As New form2
  5. nf.MyForm = Me
  6. nf.Show()
  7. Me.Hide()
  8.  
  9.  
  10. In form2 General Declaration
  11. -------------------------------------
  12.  
  13. Private pf As form1
  14.  
  15.     Public Property MyForm() As form1
  16.         Get
  17.             Return pf
  18.         End Get
  19.         Set(ByVal Value As form1)
  20.             pf = Value
  21.         End Set
  22.  
  23.     End Property
  24.  
  25. In form2 button click event
  26. ---------------------------------
  27.  If pf Is Nothing Then
  28.                     Dim pf As New form1
  29.                     pf.Show()
  30.                     Me.Hide()
  31.  
  32.                 Else
  33.                     pf.Show()
  34.                    Me.Hide()
  35.  
  36.                 End If


I'm very thankful if anybody helps me......