如何在下次打开时记住应用程序的Contextmenu用户设置?

时间:2014-04-20 05:33:52

标签: vb.net contextmenustrip

使用Visual Studio 2010 Ultimate。我添加了一个带有四个选项的contextmenustrip - 选项A,B,C和D在我的表单上。我用这样的方式编写这些文章,在给定的时间内只检查一个。它在使用时工作正常。但我想知道如何保存这些设置(如果已更改)并在下次打开应用程序时恢复。

到目前为止,这是我的代码:

    Private Sub OptionA_ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
    Handles OptionA_ToolStripMenuItem1.Click
    OptionA_ToolStripMenuItem1.Checked = True
    OptionB_ToolStripMenuItem1.Checked = False
    OptionC_ToolStripMenuItem1.Checked = False
    OptionD_ToolStripMenuItem1.Checked = False
End Sub

Private Sub OptionB_ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
    Handles OptionB_ToolStripMenuItem1.Click
    OptionB_ToolStripMenuItem1.Checked = True
    OptionA_ToolStripMenuItem1.Checked = False
    OptionC_ToolStripMenuItem1.Checked = False
    OptionD_ToolStripMenuItem1.Checked = False
End Sub

Private Sub OptionC_ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
    Handles OptionC_ToolStripMenuItem1.Click
    OptionC_ToolStripMenuItem1.Checked = True
    OptionA_ToolStripMenuItem1.Checked = False
    OptionB_ToolStripMenuItem1.Checked = False
    OptionD_ToolStripMenuItem1.Checked = False
End Sub

Private Sub OptionD_ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
    Handles OptionD_ToolStripMenuItem1.Click
    OptionD_ToolStripMenuItem1.Checked = True
    OptionC_ToolStripMenuItem1.Checked = False
    OptionA_ToolStripMenuItem1.Checked = False
    OptionB_ToolStripMenuItem1.Checked = False
End Sub

先谢谢!

0 个答案:

没有答案