Click here to Skip to main content
15,905,414 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i get whether a child form is running or not inside a mdi. if the child form is already executing(may be minimized) then it should be show
Posted

1. for showing form use
C#
formObj.ShowDialog() 
instead of
C#
formObj.Show()


2. You can get array of all MDI Child Form Object as
C#
mdiformObj.MdiChildren
 
Share this answer
 
Check this in Menu Click of that form
C#
if (IsFormAlreadyLoaded("frmTest") == true)
            { return; }


C#
private bool IsFormAlreadyLoaded(string formToLoadName) //formToLoadName is the name of the form to be checked
{
    foreach (Form frmChild in this.MdiChildren)
        {
            if (frmChild.Name == formToLoadName)
            { frmChild.Activate(); return true; }
        }
            return false;
}


Accept The Answer If It Has Helped You
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900