Customers, End Users, Developers, etc., have the ability to rename their MenuItem elements at any time.A decent way to get new developers started on the learning curve for the application.can rename MenuItem in the XML configuration file to better suit their needs or to give a MenuItem more "meaning" in their environment. Customers, end-users, developers, etc.Adding and removing ToolStripMenuItem does not require an application rebuild.This is where I originally got the idea for the XML-driven Menu Strip. Having to make a separate build for each of the customers just because we want to rename one of their menu items was not a feasible solution. This typically controls how dynamic an application should be as well as how customizable an application should be. As many developers know, customers tend to want different things out of the application. Each customer puts more focus on different areas of the application than the other customers, which is perfectly understandable. The company that I work for has multiple clients that run our application. NET 3.0 will pretty much make this control out-dated with WPF and XAML, but in the meantime, why shouldn't I be able to supply a path to an XML configuration file to setup my MenuStrip control and have it generated at run time as opposed to hard coding all the ToolStripMenuItem values at design time. The only thing I can come up with to really answer this is … "why not?" I mean. Honestly, I've battled with the concept of an XML driven menu, and while I'm still not fully convinced that it would be 100% useful in all situations … I can see how it would be useful in some applications. This is a generalized re-usable control written in such a way that it can be easily plugged in to any application based on the application's requirements. Things like: Caption, Name, Text, and the corresponding Event it has to trigger when a user clicks a MenuItem. The MenuStrip will be based on XML data which contains all the details about the generated menu. Provides basic functionality for controls derived from ToolStripItem that display drop-down items when clicked.In this article, I'll be showing how you can generate a dynamic MenuStrip (.NET 2.0's replacement of the MainMenu control) via an XML Configuration file, using recursion in C#. Represents a control that enables the user to select a single item from a list that is displayed when the user clicks a ToolStripDropDownButton or a higher-level menu item. Represents a selectable option displayed on a MenuStrip or ContextMenuStrip. The following table shows the important ContextMenuStrip companion classes. The ContextMenuStrip control is designed to work seamlessly with the new ToolStrip and related controls, but you can associate a ContextMenuStrip with other controls just as easily. Shortcut menus provide options for the client area or the control at the mouse pointer location. Shortcut menus, also called context menus, appear at the mouse position when the user clicks the right mouse button. The ContextMenuStrip control replaces and adds functionality to the ContextMenu control however, the ContextMenu control is retained for backward compatibility and future use if you choose.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |