how to avoid multiple instance for form

Posted by .Netlearner under ASP.NET on 6/27/2013 | Points: 10 | Views : 885 | Status : [Member] | Replies : 1
hello all,

I have form1 , Form2, form3. in form1 i have two button each when clicked displays Button2->Form2 and Button3->Form3. on button click i have the following code

Private Sub Click2()

Static Dim f3 As New Form3()
f3.Show()
End Sub


want to hide form2 while clicking button3. and the i must avoid multiple instance, only one object must be created.How could i acheive this. Please guide me




Responses

Posted by: Vuyiswamb on: 7/9/2013 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
Declare the Form instance globally so that they can be accessible in all button events

Thank you for posting at Dotnetfunda
[Administrator]

.Netlearner, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response