Feb 4, 2014

Change Form Events From Another Form(Hide,Close,Show)

When Ever You Want To Do Any Events Like  Hide,Close,Show Of A Form From Another Form You Can Use Following Code.
When Ever Dispose a Object In A Form From Another Form Make Sure All The Child Class Objects Relevant To That Object Are Closed.


for (int index = Application.OpenForms.Count - 1; index >= 0; index--)
{
    if (Application.OpenForms[index].Name == "Your Form Name")
    {
        Application.OpenForms[index].Close();//To Close
    }
    else if (Application.OpenForms[index].Name == "Your Form Name")
    {
        Application.OpenForms[index].Hide();//To Hide
    }
    else if (Application.OpenForms[index].Name == "Your Form Name")
    {
        Application.OpenForms[index].Show();//To Show
    }
}


No comments:

JWT Token Decode Using Jquery

When it come to authentication we use many mechanism. Ones the user authenticated we must keep these details somewhere safe. So we can share...