CommandBar Save and Load Layout for WinForms C# Tutorial
The WinForms CommandBar control is a powerful and easy to use user interface control for Windows Forms. This CommandBar control provides large flexibility for developers to customize it. By using the WinForms CommandBar control, developers can add and remove items, rearrange strip elements on different rows elements. The Save and Load layout functionality is able to help developers preserve user settings on location, visibility and orientation in their Windows Forms applications. With the Save layout feature, all the preferences of a user can be kept in an xml file. With the Load layout functionality, users can apply the layout settings to Command Bar.
The following C# Code shows a sample to implement a Save Layout button event handler by using the CommandBar control in Windows Forms template projects. Use the following C# code to initialize the layout.
The following C# code snippets illustrate the process of implementing a Load Layout button event handler in a Windows Forms template projects.
While using the Save and Load layout functionality, developers should pay attention on things that the Load layout will only load the settings for the items that the layout has been saved. The Load layout will not load and recreate the items that had been deleted. How to Save and Load Scenario of CommandBar
The C# Code snippet below shows a sample to save the layout settings of a CommandBar after closing the parent form of the command bar as well as loading these settings when reopening this form. Normally, developers need to handle the Load and Form Closing events of the form.
|
UI Controlsfor Windows Forms .NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI DesignWinForms UI Controls WinForms Buttons UI Control WinForms Calendar UI ControlWinForms Carousel UI ControlWinForms Chart UI ControlWinForms Clock UI ControlCommandBar UI ControlStructureDesign TimeItem TypesSave & Load LayoutFloating StripsOverFlow ButtonLocalizationWinForms Dock UI ControlDesktop Alert UI ControlDropDown List UI ControlWinForms Editor UI ControlForms and Dialogs UI ControlWinForms GridView UI ControlWinForms ListView UI ControlWinForms Menu UI ControlWinForms ComboBox UI ControlWinForms PageView UI ControlPanels and Labels UI ControlWinForms Panorama UI ControlWinForms PDFViewer UI ControlWinForms Property Grid UI ControlWinForms Ribbon UI ControlWinForms PivotGrid UI ControlWinForms RichTextBox UI ControlWinForms Rotator UI ControlWinForms Scheduler UI ControlWinForms Shortcuts UI ControlWinForms SpellChecker UI ControlWinForms Track & Status UI ControlWinForms TreeView UI ControlWinForms Wizard UI ControlWinForms Test UI ControlWinForms Theme UI Control |