473,386 Members | 1,754 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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
Nov 16 '05 #1
6 2279
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" <de*******@primacode.com> wrote in message
news:eP**************@TK2MSFTNGP12.phx.gbl...
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

Nov 16 '05 #2
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 misunderstanding, please feel free to let me know.

I think we can use ComboBox.SelectedIndex 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."

Nov 16 '05 #3
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-****@online.microsoft.com> wrote in message
news:aC**************@cpmsftngxa10.phx.gbl...
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 misunderstanding, please feel free to let me know.

I think we can use ComboBox.SelectedIndex 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."

Nov 16 '05 #4
Kevin:

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

thanks,

Dennis

"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:aC**************@cpmsftngxa10.phx.gbl...
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 misunderstanding, please feel free to let me know.

I think we can use ComboBox.SelectedIndex 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."

Nov 16 '05 #5
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.SelectedItem. If
you need to get the text directly, use ComboBox.SelectedText.

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."

Nov 16 '05 #6
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-****@online.microsoft.com> wrote in message
news:V4**************@cpmsftngxa10.phx.gbl...
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.SelectedItem. If
you need to get the text directly, use ComboBox.SelectedText.

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."

Nov 16 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: babylon | last post by:
any facilities in csharp that can help me implmenting undo/redo in my application? thx
11
by: Mad Joe | last post by:
I'm using a richTextBox for editing a source code (with Syntax Highlighting) of my own programming language... How come that myRichTextBox doesn't respond to Undo/Redo functions by using default...
2
by: Christian H | last post by:
Hello, I've tried to find information about how to implement an Undo/Redo pattern. This article describes such a pattern: http://www.codeproject.com/csharp/PcObjectUndo.asp , but is a little bit...
8
by: Dennis C. Drumm | last post by:
Is there a way to modify the standard context menu shown when someone right clicks in a windows text box and that would work for all open windows applications? The standard context menu for...
0
by: nail | last post by:
Hi. I have this xml file: <menu> <header caption="File"> <item header="File" caption="New File"></item> <item header="File" caption="Open File"></item> <item header="File" caption="Close...
1
by: goRide | last post by:
Hi, I'm looking of a way (preferred - a ready class or dll) to customize the context menu. many application has more controls inside the context menu (like textbox, sliders, checkbox, panel...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.