Ragazzi devo lavorare sempre da solo....
Ecco a voi la soluzione...
codice:
Function getForm(ByVal conteiner As Form, ByVal nome As String) As Form
Dim f As Form
For Each f In conteiner.MdiChildren
If f.Name = nome Then
Return f
Exit Function
End If
Next
End Function
Private Sub MenuAnagrafica_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuAnagrafica.Click
If Me.MdiChildren.Length = 0 Or getForm(Me, "anagrafica") Is Nothing Then
Dim frm As New Anagrafica
frm.Name = "anagrafica"
frm.MdiParent = Me
frm.Show()
Else
'getForm(Me, "anagrafica").Show()
getForm(Me, "anagrafica").Focus()
End If
End Sub
La seconda procedura su effettua per ogni menuitem che apre ogni form...
Ciao Ciao :mavieni: