在全屏启动时,应用程序停留在任务栏后面

Pea*_*lyk 7 delphi

这是我正在使用的代码:

BorderStyle := bsNone;
WindowState := wsMaximized;
Run Code Online (Sandbox Code Playgroud)

我的问题是应用程序不会覆盖任务栏,而是支持它.

它在运行时切换到全屏时工作正常,但在系统启动时启动应用程序时不起作用.

UPDATE

事实证明,这两条线的效果非常好.它们位于FormShow事件处理程序中.如果我在FormShow结束时断点,应用程序似乎全屏; 我可以通过任务栏看到该应用程序.但是在FormShow之后,应用程序的Top属性会以某种方式发生变化.我没有在代码中更改它 - 值为-20,因此应用程序不再最大化.

有没有办法跟踪更改的位置或时间?

提前致谢!

UPDATE

这篇文章被标记.请不要发布任何答案!谢谢.

小智 1

尝试:

Form.Left := 0; // set the x
Form.Top := 0; // set the y
Form.Width := Screen.Width; // width of the form
Form.Height := Screen.Height; // height of the form
// and
Form.FormStyle := fsStayOnTop; // taskbar is always on top as well, setting the Style property to always on top will allow the form to cover the taskbar
Run Code Online (Sandbox Code Playgroud)

如果您想隐藏标题,请将 borderstyle 设置为 bsnone

  • @André - AFAIU 这个问题不涉及在显示表单后阻止任务栏激活。 (2认同)