为什么我不能从最小化返回我的应用程序?

问题描述

我在Google上进行了搜索,我所看到的所有网站都告诉我相同的事情,以最小化我的应用程序,然后将其恢复为正常。我可以将其最小化,但是当我单击任务栏中的图标时,什么也没有发生。这是我的代码。

ELEMENT_ARRAY_BUFFER

我也尝试过

private void Form1_SizeChanged(object sender,EventArgs e)
        {
            bool PointerNotOnTaskbar = Screen.GetWorkingArea(this).Contains(Cursor.Position);
            if (this.WindowState == FormWindowState.Minimized && PointerNotOnTaskbar)
            {
                notifyIcon1.Icon = SystemIcons.Application;
                this.ShowInTaskbar = false;
                notifyIcon1.Visible = true;
                
            }
        }
        private void notifyIcon1_MouseDoubleClick(object sender,MouseEventArgs e)
        {
            this.ShowInTaskbar = true;
            WindowState = FormWindowState.Normal;
            notifyIcon1.Visible = false;

            
        }

解决方法

评论以下内容:this.ShowInTaskbar = false;
如果该表单已最小化并且在任务栏中不可见,则将使用咒语将其恢复!

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...