0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

VB.NET Settingsを初期化する方法

Last updated at Posted at 2023-07-12

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
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?