473,386 Members | 1,828 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.

MenuItems, I'm trying to figure out how to do this....

M

Hopefully this will come out right but this is what I'd like

Shapes
=======
Squares
|___by color
|___Red
|___Yellow
|___by size
|__Large
|__Medium
|__Small
Circles
Triangles

Is there a way to have the sub menus attached to Circles and Triangles
without manually adding each one in the code? Yes that would be merging
right? ok now how can I determine who called Large Yellow or Small Red, do
I have to do something like sender->parent->parent->text ?

Thanks

Nov 16 '05 #1
4 1126
MenuItem byColorMenuCloneForCircle = byColorMenu.CloneMenu();
MenuItem byColorMenuCloneForTriangle = byColorMenu.CloneMenu();

CircleMenu.MenuItems.Add(byColorMenuCloneForCircle );
TriangleMenu.MenuItems.Add(byColorMenuCloneForTria ngle );

--
Shak
(Houston)


"M" <ne**@news.com> wrote in message
news:eY**************@TK2MSFTNGP10.phx.gbl...

Hopefully this will come out right but this is what I'd like

Shapes
=======
Squares
|___by color
|___Red
|___Yellow
|___by size
|__Large
|__Medium
|__Small
Circles
Triangles

Is there a way to have the sub menus attached to Circles and Triangles
without manually adding each one in the code? Yes that would be merging
right? ok now how can I determine who called Large Yellow or Small Red, do I have to do something like sender->parent->parent->text ?

Thanks

Nov 16 '05 #2
Hi "M" (please specify a real name when posting news),

"M" <ne**@news.com> wrote in message
news:eY**************@TK2MSFTNGP10.phx.gbl...

Is there a way to have the sub menus attached to Circles and Triangles
without manually adding each one in the code? Yes that would be merging
right? ok now how can I determine who called Large Yellow or Small Red,
do
I have to do something like sender->parent->parent->text ?

Yes, I believe you have to check the sender-parameter in the event handler,
and trace back as needed.

(Of course you have to wire up the Circles and Triangles MenuItems with the
same sub menus).

Have you thought about redesigning your application, so that there is a more
intuitive way
of selecting your shapes? (e.g. a palette control).

Regards,

Lars Wilhelmsen
Software Engineer
Teleplan A/S, Norway
Nov 16 '05 #3
M

"Lars Wilhelmsen" <la*****@NOSPAM.ifi.uio.no> wrote in message
news:us**************@TK2MSFTNGP10.phx.gbl...
Hi "M" (please specify a real name when posting news),

"M" <ne**@news.com> wrote in message
news:eY**************@TK2MSFTNGP10.phx.gbl...

Is there a way to have the sub menus attached to Circles and Triangles
without manually adding each one in the code? Yes that would be merging
right? ok now how can I determine who called Large Yellow or Small Red,
do
I have to do something like sender->parent->parent->text ?
Yes, I believe you have to check the sender-parameter in the event

handler, and trace back as needed.

(Of course you have to wire up the Circles and Triangles MenuItems with the same sub menus).

Have you thought about redesigning your application, so that there is a more intuitive way
of selecting your shapes? (e.g. a palette control).

Regards,

Lars Wilhelmsen
Software Engineer
Teleplan A/S, Norway


Thanks for replying.

Its actually not shapes at all but I was just using them as an example. It's
more like a tree control filled with various sets of data and on each set of
data I need to run different statistics. The statistics need to be able to
to be run over the last 5, 10, 15 etc test runs. So it will look like
the tree

Dataset1
|_______statistic1
|_______Last 5 test runs
|_______Last 10 test runs
|_______Last 15 test runs
|_______All test runs in August
|_______All test runs in July
|_______statistic2
|_______Last 5 test runs
|_______Last 10 test runs
|_______Last 15 test runs
|_______All test runs in August
|_______All test runs in July
Dataset2
|_______statistic1
|_______Last 5 test runs
|_______Last 10 test runs
|_______Last 15 test runs
|_______All test runs in August
|_______All test runs in July
Dataset3
|_______statistic1
|_______Last 5 test runs
|_______Last 10 test runs
|_______Last 15 test runs
|_______All test runs in August
|_______All test runs in July
Not exactly like this but something similiar. But you see I need to be able
to determine which Dataset and which statistic triggered the call. It looks
like I might have to do the parent->parent.text thing.

Thanks
Nov 16 '05 #4
M
Thanks

"Shakir Hussain" <sh**@fakedomain.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
MenuItem byColorMenuCloneForCircle = byColorMenu.CloneMenu();
MenuItem byColorMenuCloneForTriangle = byColorMenu.CloneMenu();

CircleMenu.MenuItems.Add(byColorMenuCloneForCircle );
TriangleMenu.MenuItems.Add(byColorMenuCloneForTria ngle );

--
Shak
(Houston)


"M" <ne**@news.com> wrote in message
news:eY**************@TK2MSFTNGP10.phx.gbl...

Hopefully this will come out right but this is what I'd like

Shapes
=======
Squares
|___by color
|___Red
|___Yellow
|___by size
|__Large
|__Medium
|__Small
Circles
Triangles

Is there a way to have the sub menus attached to Circles and Triangles
without manually adding each one in the code? Yes that would be merging
right? ok now how can I determine who called Large Yellow or Small Red,

do
I have to do something like sender->parent->parent->text ?

Thanks


Nov 16 '05 #5

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

Similar topics

0
by: Dan H | last post by:
I'm trying to add menu items dynamically in the Popup event of a MenuItem in an MDI child form. Actually, I'm using the Genghis MRU class, but have also dumbed it down to a simple test case in a...
0
by: Deutsche Dogge | last post by:
Hi. I'M having a weird problem with addign menuitems to a menu dynamically on the popup event of the menuitem containing the container of the menuitems i wanna add (tools -> external -> {list of...
0
by: Kreisquadratur | last post by:
Below is s snippet of my code, which should add menuitems as a submenu of an item in a contextmenu. But only the first time the contextmenu opens the entrys are set correctly. I just don't know why...
0
by: Brian | last post by:
Create a simple MDI form and a child form, and try the following simple code to add a new menu item on the Edit menu popup: private void editMenu_Popup(object sender, System.EventArgs e) {...
5
by: Davie | last post by:
I'm developing an application on the smartphone. To reduce the size of the application i'm using panels where appropriate instead of forms. As a result of the design, I need to have different...
5
by: Jorge Cavalheiro | last post by:
Hello I am trying to browse thru all menuitens of contextmenus. The form has 3 contextmenus. mi and mi2 as menuitems, f is a form For Each mi In f.ContextMenu.MenuItems For Each mi2 In...
4
by: Ray Cassick \(Home\) | last post by:
I am in a bit of a bind. I can't believe I cannot figure this out but I have been at it all day and it is just not coming to me. I am building menus on a form based upon an XML file. I have...
3
by: active | last post by:
I have a mainmenu menuitem that contains a Recently Used Files menuitem If at design time I include a menuitem in the Recently Used Files menuitem collection it will display OK If I...
1
by: cnixuser | last post by:
Hello, I am currently attempting to modify an ASP.NET menu that I found online so that I will be better able to control the look and feel of menus that I create in the future. The current one that I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.