MenuStrip的自动显示

        /// <summary>
        /// 主界面接受F11时,显示菜单
        /// 通过改写Form的ProcessCmdKey实现
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="KeyData"></param>
        /// <returns></returns>
        protected override bool ProcessCmdKey(ref Message msg, Keys KeyData)
        {
            if(KeyData == Keys.F11)
            {
                this.menuStrip1.Visible = !this.menuStrip1.Visible;
            }

            return base.ProcessCmdKey(ref msg, KeyData);
        }

  

posted @ 2017-10-20 11:58  mCat  Views(310)  Comments(0Edit  收藏  举报