Is there an easy way to show an dialog when the program is started for the first time (and only the first time), for some kind of instruction or specifying settings?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
You can have bool value in your settings file which is a "user setting" which means you can change it to true save it for this specific user. When your application starts just check that value. If it's false show your dialog and change it to true and it will stay true.
Here's an MSDN link on user settings: http://msdn.microsoft.com/en-us/library/bb397750(v=vs.110).aspx
You could save it as a bool in your settings and you should check at load event of first form. Your settings file should have a setting that I called "FirstRun" do this with following steps:
Note: The
Scope
can be changed to "Application", if that is your application's need, since you didn't mention in your question.Your Settings file should look like image below:
Note:
wrote this from my phone, so I couldn't compile to testEdit: Checked code and added image from desktop.
Ok, so I assume you're creating WinForms application. First of all, locate the Load event in your main Form event lists (or simply double click your Form in Designer panel). The following method stub will pop up:
And modify it like this: