cee1891
asked on
How can i contorl the menu in vb.net
Hei
I can't handle da menu in da way dat if once the menu is been clicked the form will appear and other time if da same menu is been clicked it shouldn't appear again dat same form or in other words shouldn't make n new instance ..
one way was of disabling n other of making it visible = false ... but ain't working ...
I can't handle da menu in da way dat if once the menu is been clicked the form will appear and other time if da same menu is been clicked it shouldn't appear again dat same form or in other words shouldn't make n new instance ..
one way was of disabling n other of making it visible = false ... but ain't working ...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Public Class Form1
Inherits System.Windows.Forms.Form
Private WithEvents f2 As Form2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If f2 Is Nothing Then
f2 = New Form2
f2.Show()
Else
If f2.WindowState = FormWindowState.Minimized Then
f2.WindowState = FormWindowState.Normal
End If
f2.Focus()
End If
End Sub
Private Sub f2_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles f2.Closed
f2 = Nothing
End Sub
End Class