Need to create the equivalent of a MainMenu Popup event

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Academia

    Need to create the equivalent of a MainMenu Popup event

    ContextMenu has a Popup event but MainMenu does not.

    I need Popup with MainMenu.

    Do you know anyway to simulate it?


    Thanks in advance



  • Teemu

    #2
    Re: Need to create the equivalent of a MainMenu Popup event


    "Academia" <academiaNOSPAM @a-znet.comkirjoit ti viestissä
    news:eNPRj2KcIH A.4888@TK2MSFTN GP05.phx.gbl...
    ContextMenu has a Popup event but MainMenu does not.
    >
    I need Popup with MainMenu.
    >
    Do you know anyway to simulate it?
    I have to ask you again why you want to use these old menus?

    If you can use MenuStrip, there is MenuActivate event and then
    DropDownOpening event for MenuItems.

    -Teemu

    Comment

    • Academia

      #3
      Re: Need to create the equivalent of a MainMenu Popup event



      I have a UserControl that has a ContextMenu, ContextMenu1, and a
      GetContextMenu public function that returns ContextMenu1.

      The form containing the UserControl uses GetContextMenu to get ContextMenu1
      and merges it with it's MainMenu.


      So your challenge is to do the same thing using the Strip elements!


      Actually there is about 30 usercontrols and 50 forms so I'm not interested
      in a completely new approach only in how to convert this approach to the
      newer menus. Can you do it?

      I doubt it because about a year ago I tried and also searched the internet
      and only found others asking similar questions not getting answered.


      Thanks for the interest





      "Teemu" <tsirkia@hotmai l.comwrote in message
      news:YwHtj.2980 16$DE.16711@rea der1.news.sauna lahti.fi...
      >
      "Academia" <academiaNOSPAM @a-znet.comkirjoit ti viestissä
      news:eNPRj2KcIH A.4888@TK2MSFTN GP05.phx.gbl...
      >ContextMenu has a Popup event but MainMenu does not.
      >>
      >I need Popup with MainMenu.
      >>
      >Do you know anyway to simulate it?
      >
      I have to ask you again why you want to use these old menus?
      >
      If you can use MenuStrip, there is MenuActivate event and then
      DropDownOpening event for MenuItems.
      >
      -Teemu

      Comment

      • Teemu

        #4
        Re: Need to create the equivalent of a MainMenu Popup event


        "Academia" <academiaNOSPAM @a-znet.comkirjoit ti viestissä
        news:%231Y7L2Pc IHA.5712@TK2MSF TNGP04.phx.gbl. ..
        >
        >
        I have a UserControl that has a ContextMenu, ContextMenu1, and a
        GetContextMenu public function that returns ContextMenu1.
        >
        The form containing the UserControl uses GetContextMenu to get
        ContextMenu1 and merges it with it's MainMenu.
        >
        >
        So your challenge is to do the same thing using the Strip elements!
        OK, I can see your problem. One way to merge ContextMenuStri p to MenuStrip
        is:

        ToolStripMenuIt em1.DropDown=Co ntextMenuStrip1

        -Teemu

        Comment

        • Academia

          #5
          Re: Need to create the equivalent of a MainMenu Popup event

          Let me give a little more details and if your solution still applies I'll be
          very grateful.

          The context menu contains main menu items: File, Edit, and View.
          Each of these have menu items on them.

          The main menu has main menu items: File and View.
          These also have menu items on them.

          Can I put one DropDown item someplace so I can merge the context menu with
          the main menu so that the File and View items merge? That would be
          equivalent to what I do now.


          I would like to use the strips and if it has to be, I could make a context
          menu for each of the main menu items: File, Edit, and View and have a
          DropDown for each. Is that what I have to do?


          Thanks for staying with me. I'd love to be able to use the newer menus!




          "Teemu" <tsirkia@hotmai l.comwrote in message
          news:EqXtj.2982 46$bh2.42637@re ader1.news.saun alahti.fi...
          >
          "Academia" <academiaNOSPAM @a-znet.comkirjoit ti viestissä
          news:%231Y7L2Pc IHA.5712@TK2MSF TNGP04.phx.gbl. ..
          >>
          >>
          >I have a UserControl that has a ContextMenu, ContextMenu1, and a
          >GetContextMe nu public function that returns ContextMenu1.
          >>
          >The form containing the UserControl uses GetContextMenu to get
          >ContextMenu1 and merges it with it's MainMenu.
          >>
          >>
          >So your challenge is to do the same thing using the Strip elements!
          >
          OK, I can see your problem. One way to merge ContextMenuStri p to MenuStrip
          is:
          >
          ToolStripMenuIt em1.DropDown=Co ntextMenuStrip1
          >
          -Teemu

          Comment

          • Teemu

            #6
            Re: Need to create the equivalent of a MainMenu Popup event


            "Academia" <academiaNOSPAM @a-znet.comkirjoit ti viestissä
            news:uHlOfUXcIH A.3400@TK2MSFTN GP03.phx.gbl...
            Let me give a little more details and if your solution still applies I'll
            be very grateful.
            >
            The context menu contains main menu items: File, Edit, and View.
            Each of these have menu items on them.
            >
            The main menu has main menu items: File and View.
            These also have menu items on them.
            >
            Can I put one DropDown item someplace so I can merge the context menu with
            the main menu so that the File and View items merge? That would be
            equivalent to what I do now.
            If you need to merge menus like you described the operation is not so
            simple. You can make menu item "Merge here" in the main menu and then easily
            to merge all items to that item but merging to severeal points must be done
            manually.

            Is the context menu used as context menu or could it be converted to menu
            strips? If that is possible then the merging process will be quite easy. You
            could also create invisible menu strip in your user control and use that as
            context menu also.

            -Teemu

            Comment

            • Academia

              #7
              Re: Need to create the equivalent of a MainMenu Popup event


              "Teemu" <tsirkia@hotmai l.comwrote in message
              news:xwYtj.2982 88$wS2.262096@r eader1.news.sau nalahti.fi...
              >
              "Academia" <academiaNOSPAM @a-znet.comkirjoit ti viestissä
              news:uHlOfUXcIH A.3400@TK2MSFTN GP03.phx.gbl...
              >Let me give a little more details and if your solution still applies I'll
              >be very grateful.
              >>
              >The context menu contains main menu items: File, Edit, and View.
              >Each of these have menu items on them.
              >>
              >The main menu has main menu items: File and View.
              >These also have menu items on them.
              >>
              >Can I put one DropDown item someplace so I can merge the context menu
              >with the main menu so that the File and View items merge? That would be
              >equivalent to what I do now.
              >
              If you need to merge menus like you described the operation is not so
              simple. You can make menu item "Merge here" in the main menu and then
              easily to merge all items to that item but merging to severeal points must
              be done manually.
              >
              Is the context menu used as context menu or could it be converted to menu
              strips? If that is possible then the merging process will be quite easy.
              You could also create invisible menu strip in your user control and use
              that as context menu also.
              >
              -Teemu
              The context menu is used as the usercontrol's context menu.
              And the same items appear on the form's main menu.

              Seems you gave me a couple of options.
              I believe you understand the problem and have much more insight than I have.

              I don't need the way with the less effort.
              I'd like the result to be the most straightforward code.

              Can you recommend a method.

              As I read what you wrote it seems like I can create an invisible menu strip
              in the user control and use that for both the user control's context menu
              and for the form's main menu. Is that correct?

              Is that the method with the most straightforward code.

              Thanks a lot















              Comment

              • Teemu

                #8
                Re: Need to create the equivalent of a MainMenu Popup event


                "Academia" <academiaNOSPAM @a-znet.comkirjoit ti viestissä
                news:OLYumCYcIH A.5208@TK2MSFTN GP04.phx.gbl...
                As I read what you wrote it seems like I can create an invisible menu
                strip in the user control and use that for both the user control's context
                menu and for the form's main menu. Is that correct?
                >
                Is that the method with the most straightforward code.
                I think this could be the easiest solution. I tried this myself but I
                encountered some strange problems. I noticed that some items were moved to
                another menu not copied. Merging operation worked as I thought.

                I'll look if I can make a nice solution.

                -Teemu

                Comment

                • Teemu

                  #9
                  Re: Need to create the equivalent of a MainMenu Popup event


                  "Teemu" <tsirkia@hotmai l.comkirjoitti viestissä
                  news:kgZtj.2983 14$m63.39584@re ader1.news.saun alahti.fi...
                  I'll look if I can make a nice solution.
                  Unfortunately I have to admit that I can't get it work. If I could easily
                  make a clone from MenuStrip then my idea would work as I thought.

                  Now when I create a context menu from this menu strip, the items will be
                  removed from menu strip and so they cannot be merged to another menu strip.

                  What was the original purpose for this popup event? Maybe we can find
                  another way to implement it.


                  -Teemu

                  Comment

                  • Academia

                    #10
                    Re: Need to create the equivalent of a MainMenu Popup event

                    I really appreciate you trying.

                    I note also that no one else has indicated they know how.

                    I down loaded an example only to find he had duplicate memu items. That is,
                    he created both the menustrip and also put duplicates on the contextstrip.

                    Thanks again.


                    "Teemu" <tsirkia@hotmai l.comwrote in message
                    news:fDDuj.2991 52$ZB.129530@re ader1.news.saun alahti.fi...
                    >
                    "Teemu" <tsirkia@hotmai l.comkirjoitti viestissä
                    news:kgZtj.2983 14$m63.39584@re ader1.news.saun alahti.fi...
                    >
                    >I'll look if I can make a nice solution.
                    >
                    Unfortunately I have to admit that I can't get it work. If I could easily
                    make a clone from MenuStrip then my idea would work as I thought.
                    >
                    Now when I create a context menu from this menu strip, the items will be
                    removed from menu strip and so they cannot be merged to another menu
                    strip.
                    >
                    What was the original purpose for this popup event? Maybe we can find
                    another way to implement it.
                    >
                    >
                    -Teemu

                    Comment

                    Working...