如何在软件运行时覆盖PC屏幕,隐藏任务栏。 [英] How to cover PC screen, hide task bar , when software run.

查看:104
本文介绍了如何在软件运行时覆盖PC屏幕,隐藏任务栏。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I have developed Point of sale application in c# and i have following two requirements:

1. I want when user start up computer then POS will start up automatic

Solutions Tried : I Know there is a startup folder where we can copy shortcut of software and on computer start up this application will start up automatic. Is there any better practice to that.

2. User not able to see taskbar or POS will cover whole screen. Requirement is user cannot use computer for another purpose.

I have no idea how to implement 2.





我尝试了什么:





What I have tried:

For first req:  I Know there is a startup folder where we can copy shortcut of software and on computer start up this application will start up automatic. Is there any better practice to that





第二次请求尝试的解决方案如下。有了这个解决方案,我们可以隐藏任务栏,但如果我们按下窗口键形式键盘,那么我们可以做任何事情。所以我正在寻找能够通过良好解决方案解决这个问题的解决方案。



public void EnterFullScreenMode(Form targetForm)

{

targetForm.WindowState = FormWindowState.Normal;

targetForm.FormBorderStyle = FormBorderStyle.None;

targetForm.WindowState = FormWindowState.Maximized;

}



Solution tried for 2nd req is following. With this solution we can hide task bar but if we press window key form keyboard then we can do any thing. So i am looking for solution that can solve this problem with good solution.

public void EnterFullScreenMode(Form targetForm)
{
targetForm.WindowState = FormWindowState.Normal;
targetForm.FormBorderStyle = FormBorderStyle.None;
targetForm.WindowState = FormWindowState.Maximized;
}

推荐答案

只需将表单设置为Topmost,没有边框样式,然后设置最大化。



注意:这必须按照以下顺序进行,否则将无法正常工作。

Just set the form to Topmost with no border style, then set maximized.

Note: This must be done in the order below or it will not work correctly.
protected override void OnLoad(EventArgs e)
{
    base.OnLoad(e);
    this.TopMost = true;
    this.FormBorderStyle = FormBorderStyle.None;
    this.WindowState = FormWindowState.Maximized;
}





或者你可以参加活动而不是覆盖。





Alternatively you can hook to the event rather than overriding.

private void Form1_Load(object sender, EventArgs e)
{
    this.TopMost = true;
    this.FormBorderStyle = FormBorderStyle.None;
    this.WindowState = FormWindowState.Maximized;
}


这篇关于如何在软件运行时覆盖PC屏幕,隐藏任务栏。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆