Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
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


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;
}
Posted
Updated 13-Feb-17 19:55pm
v2
Comments
[no name] 13-Feb-17 6:42am    
The search term you are looking for is "kiosk mode"
Member 12545398 13-Feb-17 6:57am    
Thank for reply! Yes, kiosk mode is perfect solution for such type of scenario. I have tried kiosk mode. For a kiosk device to run a Windows app,i used the assigned access feature as well. Where we can run only app that is downloaded from Store or Universal Windows Platform (UWP). How i can run winform self developed software like kiosk mode.

1 solution

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.
C#
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.

C#
private void Form1_Load(object sender, EventArgs e)
{
    this.TopMost = true;
    this.FormBorderStyle = FormBorderStyle.None;
    this.WindowState = FormWindowState.Maximized;
}
 
Share this answer
 
Comments
Member 12545398 14-Feb-17 1:47am    
I have tried this solution as well, but problem in this solution is that if u press window key from keypoard or alt+clt+del then u can do what ever u want. We can disable keyboard window key but this is not complete solution. Is there any anther way we can do ?
Ramza360 14-Feb-17 15:24pm    
Since WinForms does not support the kiosk mode, you are going to have to disable those keys, and task manager shortcuts. There are some examples of this here: http://stackoverflow.com/questions/3213606/how-to-suppress-task-switch-keys-winkey-alt-tab-alt-esc-ctrl-esc-using-low

The above link apparently works in some situations, but not all. Might consider switching to WPF?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900