Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 11th, 2007, 10:01 AM
Registered User
 
Join Date: May 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default MenuItems Question

Hi I have been learning about menuitems and trying to playabout with different properties ect.
I used a piece of code from the microsoft site to see it work.
public void CreateMyMenuItem()
{
   // submenu item array.
   MenuItem[] subMenus = new MenuItem[3];
   // Create three menu items to add to the submenu item array.
   MenuItem subMenuItem1 = new MenuItem("Red");
   MenuItem subMenuItem2 = new MenuItem("Blue");
   MenuItem subMenuItem3 = new MenuItem("Green");
   // Add the submenu items to the array.
   subMenus[0] = subMenuItem1;
   subMenus[1] = subMenuItem2;
   subMenus[2] = subMenuItem3;
   // Create an instance of a MenuItem with caption and an array of submenu
   // items specified.
   MenuItem MenuItem1 = new MenuItem("&Colors", subMenus);
}
However I tried to put seperators inbetween the menu items but could not get it to work without having to give each seperator a different name. Can it be done and if so can someone show me how it is done many thanks







Similar Threads
Thread Thread Starter Forum Replies Last Post
yes or no question grstad Classic ASP Databases 0 April 14th, 2006 04:37 AM
contains() question... CyanBlue XSLT 3 April 6th, 2006 03:37 AM
Question Ashwini Classic ASP Databases 3 January 10th, 2006 07:20 AM
a question gorji C++ Programming 2 August 11th, 2003 07:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.