Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Windows Programming - Menus

Posted on 2004-04-22
3
Medium Priority
?
253 Views
Last Modified: 2010-04-17
Hi,

I have a menu using check marks.  Each time I select an option from the menu I want the option to be checked and all other options to be unchecked.  Does anybody know how I can "refresh" the menu bar after selecting an option as after selecting nothing is changing.

Thanks,
Adrian
0
Comment
Question by:Adrian_Buz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Expert Comment

by:curt_henderson
ID: 10893121
What development environment are you using?
0
 

Author Comment

by:Adrian_Buz
ID: 10894460
I'm using C
0
 
LVL 1

Accepted Solution

by:
edkaas earned 200 total points
ID: 10904525
In my example:
Create 5 items in the menu the Main one ListItem1 beneath that one 2,3,4 and 5

then use this code:
private void menuItem2_Click(object sender, System.EventArgs e)
{
      CheckUncheck(this.menuItem2);
}

private void menuItem3_Click(object sender, System.EventArgs e)
{
      CheckUncheck(this.menuItem3);
}

private void menuItem4_Click(object sender, System.EventArgs e)
{
      CheckUncheck(this.menuItem4);
}

private void menuItem5_Click(object sender, System.EventArgs e)
{
                 CheckUncheck(this.menuItem5);
}
private void CheckUncheck(MenuItem ClickedItem)
{
      foreach(MenuItem myItem in menuItem1.MenuItems)
      {
            if(myItem.Text != ClickedItem.Text)
            myItem.Checked = false;
            else
            myItem.Checked = true;
      }
}

Take care,

Ed
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
Progress
Introduction to Processes

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question