Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6229011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:29:23+00:00 2026-05-24T09:29:23+00:00

I have a WinForm with a menu bar, a menu and a menuItem (called

  • 0

I have a WinForm with a menu bar, a menu and a menuItem (called BlaBlub).
the menu item has CheckOnClick = True and (ApplicationSettings)->(PropertyBindings)->Checked mapped to the setting SomeBool (type bool, scope user, initial value= false)

the value is read correctly from the settings-file (i use a label to check it and also the menu item gets selected/deselected when I make changes to the file between sessions).

However, using the following code I was not able to open the application, click on the menu item and store the changed value back into file

    private void Form1_FormClosed(object sender, FormClosedEventArgs e)
    {
        Properties.Settings.Default.Save();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        label1.Text = string.Format("Value is: {0}", Properties.Settings.Default.SomeBool);
    }

I was able to store the value back into file, using the following code, but since this does not seem to be the idiomatic approach, I still seek some enlightment as to how to do this.

    private void blaBlubToolStripMenuItem_CheckedChanged(object sender, EventArgs e)
    {
        Properties.Settings.Default.SomeBool = blaBlubToolStripMenuItem.Checked;
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T09:29:24+00:00Added an answer on May 24, 2026 at 9:29 am

    You said:

    the value is read correctly from the settings-file

    However, based on the code presented, that wouldn’t be correct because on load you aren’t setting the checked state. Instead, I think your testing is showing the initial persisted setting value (being false) is also the default Checked state for the menu item.

    Therefore, you should also intialize the control too by adding:

    private void Form1_Load(object sender, EventArgs e)
    {
        label1.Text = string.Format("Value is: {0}", Properties.Settings.Default.SomeBool);
        blaBlubToolStripMenuItem.Checked = Properties.Settings.Default.SomeBool;
    }
    

    Note: Ordinarily I would tell you to use databinding but you can’t because I believe MenuItem’s do not support this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a winform app. On the menu bar, far right, I placed a
Let's say I have a WinForm that has a menu strip in it. Let's
I have a Winform with a BackgroundWorker. The BackgroundWorker, among other things, has to
I have a winform app that has tabcontrols that are 3 layers deep. I
I have a WinForm app that has other child forms (not mdi). If the
I have WinForm which is a tab based and including all Tabs it has
I have a WinForms application with many menus, each menu has an average of
has anyone written a generic LaunchForm function? For all the menu items I have
I have a WinForms menuitem and I need that on menu click the new
We have a (massive) legacy WinForms app which, through a menu item, opens up

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.