Jan 14, 2013

Set Active a open form by name

   private void SetActiveForm(string Name)
        {
           foreach (Form form in Application.OpenForms)
            {
                //MessageBox.Show(form.Name);
                if (form.Name == Name)
                {
                    if(form.WindowState==FormWindowState.Minimized)
                    {
                        form.WindowState=FormWindowState.Maximized;
                    }
                    form.Activate();
                    return;
                }
            }
        }

0 comments:

Post a Comment

Nam Le © 2014 - Designed by Templateism.com, Distributed By Templatelib