VB.netでユーザの設定値等を記憶できる、settingsを初期状態に戻す方法のメモ。
初期状態は、Settings.settingsファイルで記述されている値です。
Yes or Noを確認して、Yesならsettingsを初期化する。
Form1.vb
Dim result As DialogResult = MessageBox.Show("Is it OK to remove all user settings?",
"Notice",
MessageBoxButtons.YesNo,
MessageBoxIcon.Exclamation,
MessageBoxDefaultButton.Button2)
If result = DialogResult.Yes Then
My.MySettings.Default.Reset()
MsgBox("Please restart the application", , "Restart application")
End
End If