Thread: how to check menu items if it checked is true or false?

  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    40

    how to check menu items if it checked is true or false?

    Hi guys,

    I need your help, as I have a bit of troubleshoot with the source code. When I clicked on the menuitem1 to set the menuitem1 checked to true, and when I click on the button, the messagebox is show up on my screen that says "menuitem1 checked is set to true". so when I clicked on the menuitem2 to set the menuitem1 checked as false and set menuitem2 checked as true, and when I click on the button to get messagebox that says "menuitem2 checked is set to true" but I have got the same first messagebox as I have got when I first clicked on the button. If I click the menuitem2 to get the messagebox that says "menuitem2 checked is set to true", it would not make any difference due to the source code that acting like a loop.

    Here it is:

    Code:
    #include "StdAfx.h"
    #include "Form2.h"
    #include "Form1.h"
    
    using namespace MyApplication;
    
    System::Void Form2::button1_Click(System::Object^ sender, System::EventArgs^ e)
    {
      Form1 ^form1 = gcnew Form1();
      if (form1->menuItem1->Checked == true)
      {
        MessageBox::Show("menuitem1 checked is set to true");
      }
      if (form1->menuItem2->Checked == true)
      {
        MessageBox::Show("menuitem2 checked is set to true");
      }
    }
    Anyone who would give me advice to get this resolve, I would be much appreciate.

    Thanks in advance

  2. #2
    Registered User
    Join Date
    Apr 2011
    Posts
    40
    24 hours and no one is reply. Please can someone help????????????

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Check for EOF
    By Natase in forum C Programming
    Replies: 6
    Last Post: 09-20-2001, 11:42 AM
  2. Replies: 6
    Last Post: 09-12-2001, 10:35 PM
  3. Menu problem
    By morbuz in forum Windows Programming
    Replies: 5
    Last Post: 09-09-2001, 06:10 AM
  4. Selected Items in a ListView
    By Lowas in forum Windows Programming
    Replies: 12
    Last Post: 09-01-2001, 07:17 PM
  5. Rhide compile menu.
    By WebSnozz in forum C++ Programming
    Replies: 2
    Last Post: 08-18-2001, 03:36 AM