Question

  • Creator
    Topic
  • #2165430

    c++ help with EnableMenuItem

    Locked

    by jean_guy_bureau ·

    i am looking to gray out the submenu option department and manager in my sort menu
    if i select a option in the filter
    the code that i have is
    CMenu* pMenu = GetParent()->GetMenu();
    CMenu* submenu = pMenu->GetSubMenu(0);

    //pMenu->EnableMenuItem(3,MF_BYPOSITION|MF_GRAYED);
    submenu->EnableMenuItem(ID_SORT_MANAGER,MF_BYPOSITION | MF_GRAYED);
    submenu->EnableMenuItem(ID_SORT_DEPARTMENT,MF_BYPOSITION | MF_GRAYED);

    GetParent()->DrawMenuBar();
    OnSortName();

All Answers

  • Author
    Replies
    • #2991917

      Clarifications

      by jean_guy_bureau ·

      In reply to c++ help with EnableMenuItem

      Clarifications

    • #2991894

      Eaxample …

      by older mycroft ·

      In reply to c++ help with EnableMenuItem

      • #2991881

        i saw that wb site

        by jean_guy_bureau ·

        In reply to Eaxample …

        there is some thing that i am misssing

        • #2991830

          Alert !! > Rift in space-time continuum …

          by older mycroft ·

          In reply to i saw that wb site

          Sorry, but I’m pretty sure you told me something after [i]”there is some thing that i am missing..”[/i] But it never came through.

          Please re-transmit. 😉

        • #2991813

          what am i missing i have look in the page you sent me did not work

          by jean_guy_bureau ·

          In reply to Alert !! > Rift in space-time continuum …

          what am i missing i have look in the page you sent me did not work
          i did some chage to my code what is missing or what am i missing

          CMenu* pMenu = GetParent()->GetMenu();
          CMenu* submenu = pMenu->GetSubMenu(0);

          //pMenu->EnableMenuItem(3,MF_BYPOSITION|MF_GRAYED);
          submenu->EnableMenuItem(ID_SORT_MANAGER,MF_BYCOMMAND | MF_GRAYED|MF_DISABLED);
          submenu->EnableMenuItem(ID_SORT_DEPARTMENT,MF_BYCOMMAND | MF_GRAYED|MF_DISABLED);

          GetParent()->DrawMenuBar();
          OnSortName();

        • #2991788

          The clue was in the TITLE of the last entry …

          by older mycroft ·

          In reply to what am i missing i have look in the page you sent me did not work

          SPACE – TIME continuum.

          Take some time and check the SPACE you have between your [line] values.

          You appear to be incapable of checking the SPACING of your typing. 😉

          [b][u]HINT:[/b][/u]

          Cut & Paste the example from the M$ webpage, into Notepad, place the cursor in front of the top left character, then using the ‘advance’ cursor key – do a character count of the values.

          Do the same for your own code.

          Do it line for line.

          The example has spaces that you don’t. 😉

        • #2991754

          ok just call me stupid i do not see it

          by jean_guy_bureau ·

          In reply to The clue was in the TITLE of the last entry …

          CMenu* pMenu = GetParent()->GetMenu();
          CMenu* submenu = pMenu->GetSubMenu(0);

          submenu->EnableMenuItem(ID_SORT_MANAGER,MF_BYCOMMAND | MF_GRAYED | MF_DISABLED);

          submenu->EnableMenuItem(ID_SORT_DEPARTMENT,MF_BYCOMMAND | MF_GRAYED | MF_DISABLED);
          GetParent()->DrawMenuBar();
          OnSortName();

        • #2991735

          OK – You’re STUPID !! …

          by older mycroft ·

          In reply to ok just call me stupid i do not see it

          Now, pardon me if I’m wrong, but your command of the English language appears to be substantive. Now notwithstanding the fact that you are American, and may have formed your own methodology of formatting written English, there are still a few constraints that have to be adhered to, one of which is that [b]after every comma there is usually a [u]SPACE[/u].[/b] This conformity is not just confined to [i]written[/i] English

          Sorry, if that is beyond your understanding then, that is wholly your concern. I DO NOT wish to be harsh, but if you cannot read then why are you asking questions within a text-based forum ?

          I also suggest you attempt to develop a personal sense of humour. 😉

        • #2991732

          i am not american i am french canadian

          by jean_guy_bureau ·

          In reply to ok just call me stupid i do not see it

          I i did put a space and the Comma
          And the sudmenu are still not going gray
          CMenu* pMenu = GetParent()->GetMenu();
          CMenu* submenu = pMenu->GetSubMenu(0);

          submenu->EnableMenuItem(ID_SORT_MANAGER, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);

          submenu->EnableMenuItem(ID_SORT_DEPARTMENT, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
          GetParent()->DrawMenuBar();

        • #2991731

          Use the Force – jean_guy_bureau@…

          by older mycroft ·

          In reply to ok just call me stupid i do not see it

          I’m going to give you a simple piece of advice…

          If you are incapable of viewing 2 pieces of code side-by-side (or one above the other), making adjustments as you go, you will never make it to the point of achievement.

          I gave you the chance, you DID make amendments, never admitted them then maintained there was no difference. You can’t do that if I’m snap-shotting what you post.

          READ the code – don’t just look at it. 😉

        • #2991728

          WHAT is the possible difference between …

          by older mycroft ·

          In reply to ok just call me stupid i do not see it

          “MF_BYCOMMAND”

          &

          “MF_BYPOSITION”

          …so why the juxtapose?

          You changed the code… 😉

        • #2991726

          New Brunswick, NJ, USA – And I’m supposed to guess ?…

          by older mycroft ·

          In reply to The clue was in the TITLE of the last entry …

          That you are NOT American – that you are French Canadian ????

          That’s like asking me to guess the skin colour of the Invisible Man!! 😉

    • #2991718

      HELP!! Je suis non parl? Canadien Francais! ….

      by older mycroft ·

      In reply to c++ help with EnableMenuItem

      Moi non plus!! … 😉

      Particularment – ‘sarcasme’ !

    • #2991670

      Some advice you got 6 months ago from a fellow peer …

      by older mycroft ·

      In reply to c++ help with EnableMenuItem

      http://techrepublic.com.com/5208-6230-0.html?forumID=101&threadID=267756&messageID=2536131

      ..I’m not going to spoon-feed you the answer, because if you can’t improve your analytical skills, you will inevitably arrive at Dead End Central. 😉 🙂

Viewing 3 reply threads