Hello
Hum.. for your problem, i think you could disable the menuitem when the MDI form is loaded (so when user have clicked on the menuitem). Like this, user won't be able to click on the menuitem and so, won't be able to open more than 1 MDI form.

Signature
LEBRUN Thomas
http://morpheus.developpez.com
> Dear all
> i have a parent form and have some menuitem to load midi form. how can i only allow use can only load ONE midi form of the same item
John J. Hughes II - 28 Jul 2004 16:53 GMT
I use the following function. You call the function with the name of the
form. If the form is open then show the form if the form is not open create
a new form.
private void menuDataQuery_Click(object sender, System.EventArgs e)
{
if(!this.CheckFormOpen("frmDataQuery"))
{
frmDataQuery frm = new frmDataQuery();
frm.MdiParent = this;
frm.Show();
}
}
private bool CheckFormOpen(string name)
{
foreach(System.Windows.Forms.Form frm in this.MdiChildren)
{
if(frm.Name == name)
{
frm.BringToFront();
return true;
}
}
return false;
}
Regards,
John
coding by car
Private Sub mnuFrmHandling(ByVal frmName As String)
For Each frm As Form In Me.MdiChildren
If frm.Name = frmName Then
frm.BringToFront()
Exit Sub
End If
Next
Dim frmNew As Form
Select Case frmName
Case "Persons"
frmNew = New frmPersons
Case "Actions"
frmNew = New frmActions
Case Else
frmNew = New frmTabellen(frmName)
End Select
frmNew.MdiParent = Me
frmNew.Show()
frmNew.WindowState = FormWindowState.Maximized
frmNew.Name = frmName
frmNew.BringToFront()
End Sub
regards
>Dear all
>i have a parent form and have some menuitem to load midi form. how can i only allow use can only load ONE midi form of the same item