Click here to Skip to main content
15,921,905 members
Home / Discussions / C#
   

C#

 
GeneralRe: save some xml files in a hidden folder Pin
Ravenet10-Apr-08 0:16
Ravenet10-Apr-08 0:16 
GeneralRe: save some xml files in a hidden folder Pin
Ashfield10-Apr-08 1:54
Ashfield10-Apr-08 1:54 
GeneralRe: save some xml files in a hidden folder Pin
Ahuja.bangalore10-Apr-08 3:58
Ahuja.bangalore10-Apr-08 3:58 
GeneralAuto Resize Pin
half-life9-Apr-08 21:30
half-life9-Apr-08 21:30 
GeneralRe: Auto Resize Pin
Christian Graus9-Apr-08 22:24
protectorChristian Graus9-Apr-08 22:24 
JokeRe: Auto Resize Pin
ChandraRam10-Apr-08 2:09
ChandraRam10-Apr-08 2:09 
Generalmenu control Pin
chithra.r9-Apr-08 21:23
chithra.r9-Apr-08 21:23 
GeneralRe: menu control Pin
John_Adams10-Apr-08 0:24
John_Adams10-Apr-08 0:24 
Hi Pintoo,

If you are referring to the SubMenu Items arrow then please know that it appear when we create some submenu items for a menu item like:

FileMenu
|
|
New-->SubMenuItemsList
|
|
Open

The arrow can be removed by removing the submenu items.

However, regarding your query of "how to create a menu control in .net(c#)." I would like to mention that we can create menus using C# in the following manner:

First add a MainMenu control to the form. Then to add menu items to it add MenuItem objects to the collection. By default, a MainMenu object contains no menu items, so that the first menu item added becomes the menu heading. Menu items can also be dynamically added when they are created, such that properties are set at the time of their creation and addition.

The following program shows how to create a simple menu.

The Class MenuTest1 creates a simple menu on a form. The form has a top-level File menu with menu items New,Open and Exit .The menu also includes a About menu.

-------------------------------------------------------------------------
BEGIN CODE

using System;
using System.ComponentModel;
using System.WinForms;
using System.Drawing;
public class MenuTest1 :Form
{
private MainMenu mainMenu;
public MenuTest1()
{
mainMenu = new MainMenu();
MenuItem File = mainMenu.MenuItems.Add("&File");
File .MenuItems.Add(new MenuItem("&New"));
File .MenuItems.Add(new MenuItem("&Open"));
File .MenuItems.Add(new MenuItem("&Exit"));
this.Menu=mainMenu;
MenuItem About = mainMenu.MenuItems.Add("&About");
About.MenuItems.Add(new MenuItem("&About"));
this.Menu=mainMenu;
mainMenu.GetForm().BackColor = Color.Indigo;
}
public static void Main(string[] args)
{
Application.Run(new MenuTest1());
}
}

END CODE
-------------------------------------------------------------------------

Hope this helps Smile | :) .

Regards,
John Adams
ComponentOne LLC

GeneralAvoid constructor initialization to Designer Pin
binarycat9-Apr-08 21:11
binarycat9-Apr-08 21:11 
GeneralRe: Avoid constructor initialization to Designer Pin
Nouman Bhatti9-Apr-08 21:15
Nouman Bhatti9-Apr-08 21:15 
GeneralRe: Avoid constructor initialization to Designer Pin
binarycat9-Apr-08 21:21
binarycat9-Apr-08 21:21 
GeneralRe: Avoid constructor initialization to Designer Pin
darkelv9-Apr-08 23:21
darkelv9-Apr-08 23:21 
GeneralRe: Avoid constructor initialization to Designer Pin
binarycat9-Apr-08 23:27
binarycat9-Apr-08 23:27 
GeneralFind Odd and Even number Pin
M Riaz Bashir9-Apr-08 20:50
M Riaz Bashir9-Apr-08 20:50 
GeneralRe: Find Odd and Even number Pin
mav.northwind9-Apr-08 20:57
mav.northwind9-Apr-08 20:57 
GeneralRe: Find Odd and Even number Pin
Nouman Bhatti9-Apr-08 21:18
Nouman Bhatti9-Apr-08 21:18 
AnswerRe: Find Odd and Even number Pin
carbon_golem10-Apr-08 3:20
carbon_golem10-Apr-08 3:20 
QuestionHow to modify the aseembly Pin
sujithkumarsl9-Apr-08 17:57
sujithkumarsl9-Apr-08 17:57 
GeneralPrinting word docs using word automation Pin
J. R. Anderson9-Apr-08 17:55
J. R. Anderson9-Apr-08 17:55 
QuestionA problem in multithreading Pin
Nothend9-Apr-08 17:47
Nothend9-Apr-08 17:47 
GeneralRe: A problem in multithreading Pin
Christian Graus11-Apr-08 13:13
protectorChristian Graus11-Apr-08 13:13 
QuestionHelp: Project Management App Pin
demonmaster3k9-Apr-08 16:20
demonmaster3k9-Apr-08 16:20 
QuestionGlobal lists/arrays Pin
Jerry Graham9-Apr-08 12:38
Jerry Graham9-Apr-08 12:38 
GeneralRe: Global lists/arrays Pin
Anthony Mushrow9-Apr-08 13:13
professionalAnthony Mushrow9-Apr-08 13:13 
GeneralRe: Global lists/arrays Pin
PIEBALDconsult9-Apr-08 13:19
mvePIEBALDconsult9-Apr-08 13:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.