tags:

views:

82

answers:

4

Hello, I would like to make a C# application that displays a message when the program starts up, with a button that says "Don't show this message again".

When they click that button, how do I make it not display again the next time the program is ran.

Any and all help would be greatly appreciated.

Also, I'm unsure on how to show a message with a button in it (new to c#) so help on that would be appreciated also.

Cheers,

Luke

+2  A: 

You could save this choice in the user settings.

Darin Dimitrov
A: 

You will have to store a value indicating the whether the user has clicked the box or not in an xml file, database, etc.

Assuming this is WinForms the message will be a MessageBox or a new Form.

blu
+1  A: 

You just need to record that setting somewhere that lives beyond the current life of the program.

You can use the Settings part of your project for this.

As for adding such a checkbox or whatever, you probably have to create a new form that looks like a message box.

Lasse V. Karlsen
A: 

As an alternative to user settings, both the registry and isolated storage provide valid places to store your data. One appeal of isolated storage is that you have a whole mini-file-system at your disposal, which can be convenient for very complex storage. In this specific case, however, either user settings or registry settings will provide maximum simplicity, IMO.

kbrimington
I'd avoid the registry, although it would certainly work.
Steven Sudit
@Steven - I agree, no registry please.
ChaosPandion