Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Windows Programming - Menus

Posted on 2004-04-22
3
Medium Priority
?
255 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
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

Industry Leaders: 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

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Simple Linear Regression

782 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