Skip to content

MikeBevers.be

Putting it out there…

Archive

Tag: Windows Forms

Background

Currently, I’m developing an application for a mobile device that runs on Windows XP Embedded. One of the requirements is that the application has to run in full screen mode. Also, a regular user should not be able to exit the application.

I was able to install the .NET 2.0 Framework on Windows XPe, so the front-end will be a WinForms 2.0 application.

continue reading…

How it doesn’t work

I had to create a Form that closes when the user pressed his escape button.

So I the first thing that came up was the KeyDown or KeyPress event on the Form.

private void FormParameters_KeyDown(object sender, KeyEventArgs e)
{
    if (e.KeyCode.Equals(Keys.Escape))
        this.Close();
}

private void FormParameters_KeyPress(object sender, KeyPressEventArgs e)
{
    if (e.KeyChar.Equals(Keys.Escape))
        this.Close();
}

You don’t have to try this, because it doesn’t work.

continue reading…