Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version
Go to top

An XML-Driven Menu Strip

, 16 Apr 2007
In this article, I'm going to show how to generate a dynamic MenuStrip (.NET 2.0's replacement of the MainMenu control) using recursion in C#. The MenuStrip will be based on XML data which contains all the details about the generated Menu.
menustripenhanced.zip
MenuStripEnhanced
MainMenuEnhanced
bin
Debug
MainMenuEnhanced.dll
MainMenuEnhanced.pdb
Release
MainMenuEnhanced.dll
MainMenuEnhanced.pdb
obj
Debug
MainMenuEnhanced.csproj.GenerateResource.Cache
MainMenuEnhanced.dll
MainMenuEnhanced.MenuStripEnhanced.resources
MainMenuEnhanced.MenuStripEnhancedEventArgs.resources
MainMenuEnhanced.pdb
MenuStripEnhanced.csproj.GenerateResource.Cache
Refactor
MainMenuEnhanced.dll
TempPE
Release
MainMenuEnhanced.dll
MainMenuEnhanced.MenuStripEnhanced.resources
MainMenuEnhanced.pdb
MenuStripEnhanced.csproj.GenerateResource.Cache
TempPE
Properties
MainMenuTestApp
bin
Debug
MainMenuEnhanced.dll
MainMenuEnhanced.pdb
MainMenuTestApp.exe
MainMenuTestApp.pdb
MainMenuTestApp.vshost.exe
Release
MainMenuEnhanced.dll
MainMenuEnhanced.pdb
MainMenuTestApp.exe
MainMenuTestApp.pdb
MainMenuTestApp.vshost.exe
MenuStripEnhancedTestApp.csproj.user
obj
Debug
build.force
MainMenuTestApp.csproj.GenerateResource.Cache
MainMenuTestApp.exe
MainMenuTestApp.MenuStripEnhancedForm.resources
MainMenuTestApp.MenuStripForm.resources
MainMenuTestApp.pdb
MainMenuTestApp.Properties.Resources.resources
MenuStripEnhancedTestApp.csproj.GenerateResource.Cache
Refactor
ResolveAssemblyReference.cache
TempPE
Release
MainMenuTestApp.exe
MainMenuTestApp.MenuStripEnhancedForm.resources
MainMenuTestApp.MenuStripForm.resources
MainMenuTestApp.pdb
MainMenuTestApp.Properties.Resources.resources
MenuStripEnhancedTestApp.csproj.GenerateResource.Cache
ResolveAssemblyReference.cache
TempPE
Properties
Settings.settings
MenuStripEnhanced.suo
menustripenhanced_v101.zip
MainMenuEnhanced
MainMenuEnhanced
bin
Release
MainMenuEnhanced.dll
MainMenuEnhanced.pdb
Properties
MainMenuTestApp
bin
Release
MainMenuEnhanced.dll
MainMenuEnhanced.pdb
MainMenuTestApp.exe
MainMenuTestApp.pdb
MainMenuTestApp.vshost.exe
MenuStripEnhancedTestApp.csproj.user
Properties
Settings.settings
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MainMenuTestApp
{
    public partial class MenuStripForm : Form
    {
        public MenuStripForm()
        {
            InitializeComponent();
        }

        private void Form1_Load( object sender, EventArgs e )
        {

        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Bryan Ray
Web Developer
United States United States
I've been working with C# since .NET Beta 1 and have been in the development scene since VB3.
 
I've always had a passion for development, technology, and computer as a whole. I consider myself one of the lucky few who actually love their job.
 
I've mostly been involed with web development in the corporate world, but I also work with Windows Forms development at home. Over the past 3 years or so the .NET applications I've developed have been backend maintenance applications. Transfering data, manipulating data, or doing some other back-end processes.

| Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 16 Apr 2007
Article Copyright 2007 by Bryan Ray
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid