Hi, maybe this can help you, I hope the code is clear otherwise feel free to
ask:
Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles _ MenuItem2.Click
If checkFormOpen = False Then
Dim obj As New Form2
obj.MdiParent = Me
obj.WindowState = FormWindowState.Maximized
obj.Show()
End If
End Sub
Private Function checkFormOpen() As Boolean
Dim objForm As Form
For Each objForm In Me.MdiChildren
If TypeOf objForm Is Form2 Then
objForm.WindowState = FormWindowState.Maximized
objForm.BringToFront()
Return True
End If
Next
Return False
End Function
--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.
"Vivek" <vi****@xtra.co.nz> schreef in bericht
news:uq**************@TK2MSFTNGP09.phx.gbl...
Sorry but it did not work for me
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:OX*************@TK2MSFTNGP15.phx.gbl... Hi,
If the form is already a mdichild try fc.bringtofront instead of
fc.show to reshow the form
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemwindowsformscontrolclassbringtofronttop ic.asp
Ken
--------------------
"Vivek" <vi****@xtra.co.nz> wrote in message
news:eL**************@TK2MSFTNGP10.phx.gbl...
Hi,
I am using this code to open the form...
--------------------------------------------------------------------------
-------------
Private frmAddUser as AddUser()
Dim fc As Form
For Each fc In Me.MdiParent.MdiChildren
If fc Is frmAddUser Then
If fc.WindowState = FormWindowState.Minimized Then
fc.WindowState = FormWindowState.Normal
End If
fc.Show()
fc.Focus()
Return
End If
Next
If (frmAddUser Is Nothing) Then
frmAddUser = New AddUser
frmAddUser.MdiParent = Me.MdiParent
frmAddUser.Show()
End If
---------------------------------------------------------------------
When I close the form and try to reopen it does not open the form. It
still
recognises that frmAddUser exists. How do I kill the instance when I
close
the form?
Thanks
Vivek