context menu for undo/redo buttons

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dennis C. Drumm

    context menu for undo/redo buttons

    How do I program the context menu of an undo/redo toolbar button drop down
    menu to behave like the vs.net undo where all previous menu items are
    selected as the user moves the mouse pointer down the list?

    Thanks,

    Dennis


  • Dennis C. Drumm

    #2
    Re: context menu for undo/redo buttons

    Never mind, I figured it out.

    Although I still do wonder how to get the item at the bottom of the dropdown
    list that keeps track of how many items are selected.

    Dennis


    "Dennis C. Drumm" <developer@prim acode.com> wrote in message
    news:ePjObNElEH A.2588@TK2MSFTN GP12.phx.gbl...[color=blue]
    > How do I program the context menu of an undo/redo toolbar button drop down
    > menu to behave like the vs.net undo where all previous menu items are
    > selected as the user moves the mouse pointer down the list?
    >
    > Thanks,
    >
    > Dennis
    >[/color]


    Comment

    • Kevin Yu [MSFT]

      #3
      Re: context menu for undo/redo buttons

      Hi Dennis,

      First of all, I would like to confirm my understanding of your issue. From
      your description, I understand that you need to know how to get the last
      item selected on a combo box to get the count of items selected. If there
      is any misunderstandin g, please feel free to let me know.

      I think we can use ComboBox.Select edIndex to get the current selected item.
      Since the items before the selected one are all selected, the count equals
      to SelectedIndex +1.

      HTH.

      Kevin Yu
      =======
      "This posting is provided "AS IS" with no warranties, and confers no
      rights."

      Comment

      • Dennis C. Drumm

        #4
        Re: context menu for undo/redo buttons

        Kevin

        I wanted to make sure that the all items in the list wouold be automatically
        slected as they are in the undo dropdown button in vs.net. I believe that
        can probably be done with the MenuItem.Select event.

        The other issue was how to get the text at the bottom of the dropdown that
        shows the count. I know how to get the count, what is a mistry is how to get
        the centered text at the bottom of the dropdown.

        Thanks,

        Dennis

        "Kevin Yu [MSFT]" <v-kevy@online.mic rosoft.com> wrote in message
        news:aC84j8HlEH A.2516@cpmsftng xa10.phx.gbl...[color=blue]
        > Hi Dennis,
        >
        > First of all, I would like to confirm my understanding of your issue. From
        > your description, I understand that you need to know how to get the last
        > item selected on a combo box to get the count of items selected. If there
        > is any misunderstandin g, please feel free to let me know.
        >
        > I think we can use ComboBox.Select edIndex to get the current selected
        > item.
        > Since the items before the selected one are all selected, the count equals
        > to SelectedIndex +1.
        >
        > HTH.
        >
        > Kevin Yu
        > =======
        > "This posting is provided "AS IS" with no warranties, and confers no
        > rights."
        >[/color]


        Comment

        • Dennis C. Drumm

          #5
          Re: context menu for undo/redo buttons

          Kevin:

          How do I use a ComboBox in place of a ContextMenu for the undo toolbar
          button?

          thanks,

          Dennis

          "Kevin Yu [MSFT]" <v-kevy@online.mic rosoft.com> wrote in message
          news:aC84j8HlEH A.2516@cpmsftng xa10.phx.gbl...[color=blue]
          > Hi Dennis,
          >
          > First of all, I would like to confirm my understanding of your issue. From
          > your description, I understand that you need to know how to get the last
          > item selected on a combo box to get the count of items selected. If there
          > is any misunderstandin g, please feel free to let me know.
          >
          > I think we can use ComboBox.Select edIndex to get the current selected
          > item.
          > Since the items before the selected one are all selected, the count equals
          > to SelectedIndex +1.
          >
          > HTH.
          >
          > Kevin Yu
          > =======
          > "This posting is provided "AS IS" with no warranties, and confers no
          > rights."
          >[/color]


          Comment

          • Kevin Yu [MSFT]

            #6
            Re: context menu for undo/redo buttons

            Hi Dennis,

            Could you let me know how you implement the undo button? Are you using a
            context menu or a combo box?

            As far as I know, a ComboBox does not support multiple selection. It means
            that we cannot make all the above items selected when the bottom on is
            clicked. We can only get the item selected using ComboBox.Select edItem. If
            you need to get the text directly, use ComboBox.Select edText.

            To get the text of the bottom item, use the following:
            this.comboBox1. Items[this.comboBox1. Items.Count-1].ToString();

            HTH.

            Kevin Yu
            =======
            "This posting is provided "AS IS" with no warranties, and confers no
            rights."

            Comment

            • Dennis C. Drumm

              #7
              Re: context menu for undo/redo buttons

              Kevin,

              Thanks for the comments. It turns out, I need to impliment a user control to
              get the functionality I am looking for.

              Dennis

              "Kevin Yu [MSFT]" <v-kevy@online.mic rosoft.com> wrote in message
              news:V4YveTYlEH A.2516@cpmsftng xa10.phx.gbl...[color=blue]
              > Hi Dennis,
              >
              > Could you let me know how you implement the undo button? Are you using a
              > context menu or a combo box?
              >
              > As far as I know, a ComboBox does not support multiple selection. It means
              > that we cannot make all the above items selected when the bottom on is
              > clicked. We can only get the item selected using ComboBox.Select edItem. If
              > you need to get the text directly, use ComboBox.Select edText.
              >
              > To get the text of the bottom item, use the following:
              > this.comboBox1. Items[this.comboBox1. Items.Count-1].ToString();
              >
              > HTH.
              >
              > Kevin Yu
              > =======
              > "This posting is provided "AS IS" with no warranties, and confers no
              > rights."
              >[/color]


              Comment

              Working...