ComponentOne Menus and Toolbars for WinForms
In This Topic
    Menus and Toolbars for WinForms Samples
    In This Topic

    Please be advised that this ComponentOne software tool is accompanied by various sample projects and/or demos which may make use of other development tools included with ComponentOne Studio. 

    Please refer to the pre-installed product samples through the following path:

    Documents\ComponentOne Samples\WinForms

    Click one of the following links to view a list of C1Command samples:

    Visual Basic Samples

    Sample Description
    CreateMenusInCode Shows how to create and wire up context menus in code.  Creates a C1ContextMenu for a text box completely in code, on a form that does not have any other C1Command elements. Wires up click event handlers for the menu items. Also sets up state query handlers for the commands so that their state (enabled and so on.) is kept up to date automatically by C1Command. This sample calls the C1.Win.C1Command namespace.
    ProgramOutBar This sample starts with a form containing a C1OutBar with two empty pages (created at design time). The form also contains an empty command holder. In the form load handler, several commands are created on the command holder. Two toolbars are also created and filled with links to the commands.  The toolbars are placed on the outbar pages.
    SimpleMenusInCode This sample shows how to create menus and toolbars by customizing their appearance and attaching event handlers to them in code. The sample app is a form with a rich text editor control. The form load event handler creates C1Command commands to load a text file, create a new form, or exit the application. It also creates a main menu and a toolbar that allow the user to invoke those commands.
    SimpleTextEditor Shows the basic usage of C1Command menus and toolbars.  Builds a rich text box-based text editor, with C1Command menus and floating toolbars. The toolbars are end user-customizable. Their layout and customizations are automatically saved by C1Command in the application config file. This sample uses C1ToolBar, C1ContextMenu, C1CommandMenu, C1Command, C1MainMenu, C1CommandLink, C1CommandDock, and C1CommandHolder controls.
    SimpleTextEditor2 Shows how to add an arbitrary control to a toolbar item. This sample is similar to SimpleTextEditor, but additionally includes a combo box nested in a movable and dockable C1ToolBar, implementing a simple text search. This sample uses C1ToolBar, C1CommandMenu, C1CommandControl, C1CommandDock, C1CommandHolder, C1CommandLink, C1MainMenu, C1Command, and C1ContextMenu controls.

    C# Samples

    Sample Description
    CreateMenusInCode Shows how to create and wire up context menus in code.  Creates a C1ContextMenu for a text box completely in code, on a form that does not have any other C1Command elements. Wires up click event handlers for the menu items. Also sets up state query handlers for the commands so that their state (enabled and so on.) is kept up to date automatically by C1Command. This sample calls the C1.Win.C1Command namespace.
    MdiTabs This sample shows how to use C1DockingTab to create a Visual Studio-like multiple window environments.
    NonMdiMenuMerge Shows how to merge menus using methods provided by C1Command. This sample contains two forms, both with C1MainMenu's on them. One form is created at application startup, and it is the main form of the app. It has a command to create the other form. When that form is created, its main menu is merged programmatically into the main menu of the first form, in the same way as MDI child menus are merged in Windows. This sample uses C1CommandLink, C1MainMenu, C1Command, C1CommandMenu, and C1CommandHolder controls.
    SelectMdiChildForm This sample shows how to provide a customized MDI child form selector window.  The sample project contains an inherited form, which is based on C1SelectMdiChildForm. The custom selector form overrides the default colors, and in addition to the two default buttons (ok and cancel), provides a new button close, which allows the selected window to close. This sample also shows how to invoke the selector form from code.
    SimpleMenusInCode This sample shows how to create menus and toolbars by customizing their appearance and attaching event handlers to them in code. The sample app is a form with a rich text editor control. The form load event handler creates C1Command commands to load a text file, create a new form, or exit the application. It also creates a main menu and a toolbar that allow the user to invoke those commands.