Reputation: 1947
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.
Upvotes: 5
Views: 890
Reputation: 25692
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.
Upvotes: 0
Reputation: 391724
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.
Upvotes: 2
Reputation: 13185
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.
Upvotes: 0