Home > Software engineering >  If i press right alt this hide, when i press again program shows and hide
If i press right alt this hide, when i press again program shows and hide

Time:11-03

            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

CodePudding user response:

    if (e.KeyData.ToString().ToUpper() == "RMENU")
    {
        if (alt == 2)
        {
            WindowState = WindowState.Normal;
            alt = 1;
        }
        else if (alt == 1)
        {
            WindowState = WindowState.Minimized;
            alt = 2;
        }
    }
  • Related