Hi Ajai,
A sample with even 3 forms
Hi x
\\\form 1 needs 2 buttons and a label the other forms only a button to run
it.
Option Strict On
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
#End Region
Private WithEvents frm2 As New Form2
Private WithEvents frm3 As New Form3
Private myActiveForm As Integer
Private Sub Button2_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button2.Click
myActiveForm = 2
frm2.Show()
me.Hide()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button3.Click
myActiveForm = 3
frm3.Show()
me.Hide()
End Sub
Private Sub frm2_VisibleChanged(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles frm2.VisibleChanged,
frm3.VisibleChanged
Me.Show()
Me.Label1.Text = "Return form = " & myActiveForm.ToString
End Sub
End Class
///
\\\
Public Class Form2
Inherits System.Windows.Forms.Form
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Me.Hide()
End Sub
End Class
///
\\\
Public Class Form3
Inherits System.Windows.Forms.Form
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Me.Hide()
End Sub
End Class
///
I hope this helps a little bit?
Cor
I've two or more forms on my app.
My requirement is, Have to show the first form asa the user press a button
have to hide the first form and show the second form. If the user press
the escape key on second form, this should be hidded and should show the first
form.... Can some one guide me how to achive this... (MUST USE SHOW & HIDE
FORM PROPERTIES). I tried to achive this using the below code but when i
check the Windows->Task Manager for each and every form changes it's
eating up memory and it's not getting down.