Home Forums WinForms controls Other WinForms controls Checked menu item state

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #18110 |

    I am using a SmartMeneBar, to which I have added a CheckMenuItem. I set the Checked property to “true” in the Properties pane at design time.

    Why doesn’t this code toggle the display of the checkmark for this menu item?

    private void mnuTOC_Click(object sender, Xceed.SmartUI.SmartItemClickEventArgs e)
    {
    mnuTOC.Checked = !mnuTOC.Checked;
    }

    Whenever I view the menu item, it has the checkmark (as set in design view). When I debug the event fires, however the test is always “false” on event entry, and “true” on exit.

    Imported from legacy forums. Posted by Zanderxo (had 2175 views)

    User (Old forums)
    Member
    Post count: 23064

    This event is raised when the CheckMenuItem is selected, and the behavior of this event is exactly to toggle the checkmark. So you don’t need to toggle it yourself, it will do it for you.

    And this is why you get the behavior you are experimenting, because the Checked property is already toggled once it gets to your code in the event.

    Imported from legacy forums. Posted by André (had 3154 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.