jeudi 21 mai 2015

Choosing the form to open dependent on application settings

At the moment, we have a setting in the application setting file called 'unlocked' which is a boolean data type. If this option is set to false, we want to open the EnterKey form, but if it's set to true, then open the Main form. This is the code we have tried so far:

if (Properties.Settings.Default.unlocked)
{
    Application.Run(new Main());
}
else
{
    Application.Run(new EnterKey());
}

This piece of code is being placed in the Program.cs.

Aucun commentaire:

Enregistrer un commentaire