If i press right alt this hide, when i press again program shows and hide

38 views Asked by At
            if (e.KeyData.ToString().ToUpper() == "RMENU")
            {
                if(alt==2)
                    WindowState = WindowState.Normal;
                    alt = 1;
                else
                    WindowState = WindowState.Minimized;
                    alt = 2;
            }

If i press right alt this hide, when i press again program shows and hide

1

There are 1 answers

2
Ahmed Alayat On BEST ANSWER
    if (e.KeyData.ToString().ToUpper() == "RMENU")
    {
        if (alt == 2)
        {
            WindowState = WindowState.Normal;
            alt = 1;
        }
        else if (alt == 1)
        {
            WindowState = WindowState.Minimized;
            alt = 2;
        }
    }