473,473 Members | 4,176 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Menu how to

I have a menu set up as follows.

Main Menu
Windows
Window List
<list of windows)
<Other window options>

When I click on "Window List", I want to pop up a list of window names from
a string array.

I haven't worked with this in a while and am drawing a blank.

Thanx,
Bill

Nov 16 '05 #1
5 1375
Set the MdiList property of your Window List menu item to
true, and as long as you are properly adding the MDI
windows to the form, it will track the changes, know which
one is selected and let you use the window to change
between.

-----Original Message-----
I have a menu set up as follows.

Main Menu
Windows
Window List
<list of windows)
<Other window options>

When I click on "Window List", I want to pop up a list of window names froma string array.

I haven't worked with this in a while and am drawing a blank.
Thanx,
Bill

.

Nov 16 '05 #2
I am confused.

Iam not really talking about windows here, but a list of items I get in a
string array.

I have mainMenu1, that has menuItem1 in it. When I click on menuItem1, I
want to display a list menuItems-n under menuItem1. I want to pull these
from a string array. I cannot find how to add additional menu items under
menuItem1. I'm adrift at the moment.

Thanx,
Bill

"Brendan Grant" <gr****@dahat.com> wrote in message
news:6d****************************@phx.gbl...
Set the MdiList property of your Window List menu item to
true, and as long as you are properly adding the MDI
windows to the form, it will track the changes, know which
one is selected and let you use the window to change
between.

-----Original Message-----
I have a menu set up as follows.

Main Menu
Windows
Window List
<list of windows)
<Other window options>

When I click on "Window List", I want to pop up a list of

window names from
a string array.

I haven't worked with this in a while and am drawing a

blank.

Thanx,
Bill

.

Nov 16 '05 #3
I left off, I was looking for somekind of Add method somewhere.
Nov 16 '05 #4
Hi,
Add an Click event handler to your menuItem1 and put this code in:
private void menuItem1_Click(object sender, System.EventArgs e)
{
// get the menuItem user clicked on
MenuItem menuItem = (MenuItem) sender;

// array with window names
string [] sWindowNames = { "window1", "window2"};

foreach (string sWindowName in sWindowNames)
{
// add a new item
menuItem.MenuItems.Add (sWindowName);
}
}

Beside that set the menuItem1's MdiList to true.

Hope this helps.
--
Regards,
Peter Jausovec
(http://blog.jausovec.net)

"web1110" <we***@comcast.net> je napisal v sporočilo
news:po********************@comcast.com ...
I am confused.

Iam not really talking about windows here, but a list of items I get in a
string array.

I have mainMenu1, that has menuItem1 in it. When I click on menuItem1, I
want to display a list menuItems-n under menuItem1. I want to pull these
from a string array. I cannot find how to add additional menu items under
menuItem1. I'm adrift at the moment.

Thanx,
Bill

"Brendan Grant" <gr****@dahat.com> wrote in message
news:6d****************************@phx.gbl...
Set the MdiList property of your Window List menu item to
true, and as long as you are properly adding the MDI
windows to the form, it will track the changes, know which
one is selected and let you use the window to change
between.

>-----Original Message-----
>I have a menu set up as follows.
>
>Main Menu
> Windows
> Window List
> <list of windows)
> <Other window options>
>
>When I click on "Window List", I want to pop up a list of

window names from
>a string array.
>
>I haven't worked with this in a while and am drawing a

blank.
>
>Thanx,
>Bill
>
>
>
>
>
>.
>


Nov 16 '05 #5
Ahh, my mistake.

Add does exist, it is a method of the MenuItemCollection
type object named MenuItems that both your mainMenu1 and
menuItem1 objects have.

Unfortunately, you cannot directly create a set of
MenuItems from an array of strings, you would have to
iterate through each string, creating a corresponding menu
item and add it to the parent Menu Item using the
MenuItems.Add method of menuItem1.

Sorry about the confusion, I hope this is what you are
looking for.
-----Original Message-----
I am confused.

Iam not really talking about windows here, but a list of items I get in astring array.

I have mainMenu1, that has menuItem1 in it. When I click on menuItem1, Iwant to display a list menuItems-n under menuItem1. I want to pull thesefrom a string array. I cannot find how to add additional menu items undermenuItem1. I'm adrift at the moment.

Thanx,
Bill

"Brendan Grant" <gr****@dahat.com> wrote in message
news:6d****************************@phx.gbl...
Set the MdiList property of your Window List menu item to true, and as long as you are properly adding the MDI
windows to the form, it will track the changes, know which one is selected and let you use the window to change
between.

>-----Original Message-----
>I have a menu set up as follows.
>
>Main Menu
> Windows
> Window List
> <list of windows)
> <Other window options>
>
>When I click on "Window List", I want to pop up a list
of window names from
>a string array.
>
>I haven't worked with this in a while and am drawing a

blank.
>
>Thanx,
>Bill
>
>
>
>
>
>.
>

.

Nov 16 '05 #6

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

Similar topics

1
by: Macamba | last post by:
Hi all, I am currently developing a website for a voluntary organisation. It is my first step in website development. The dynamic menu I developed has some bugs, which I addressed in another...
1
by: ajay | last post by:
I have following code for a slide menu but i twiked it to work for a single level menu. Open it in a Browser to get a clear picture. I have 2 Qs 1) How to make first entry as non-link. i.e i...
2
by: Jackson Yap | last post by:
can someone kind enough to help me look at the attached html and js file? Why is it that the javascript menu could not work at www.apchosting.net but could work at...
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...
1
by: Anthony | last post by:
Below is a script I found at http://javascript.internet.com/ for a cascading menu. The script works great but there is one thing that I would like modified. BecauseI am just learning javascript,...
4
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.