windowsforms-devexpress-dot-xtraspreadsheet-dot-spreadsheetcontrol-84c6ae54.md
Creates a BarManager that contains all SpreadsheetControl-specific bars.
Namespace : DevExpress.XtraSpreadsheet
Assembly : DevExpress.XtraSpreadsheet.v25.2.dll
NuGet Package : DevExpress.Win.Spreadsheet
public BarManager CreateBars()
Public Function CreateBars As BarManager
| Type | Description |
|---|---|
| BarManager |
A component that manages the created toolbars.
|
Use the CreateBars method overloads to create a toolbar menu that allows end users to perform basic operations in the SpreadsheetControl. The current method creates all available bars, except for the Mail Merge toolbar. You can use the AddToolbarToMenuManager method to add this toolbar to the control, as shown below:
using DevExpress.XtraBars;
using DevExpress.XtraSpreadsheet;
// ...
public Form1()
{
InitializeComponent();
// Create the Spreadsheet's toolbar menu.
BarManager bars = spreadsheetControl1.CreateBars();
// Add the Mail Merge bars to the control.
spreadsheetControl1.AddToolbarToMenuManager(SpreadsheetToolbarType.MailMerge);
bars.Form = this;
}
Imports DevExpress.XtraBars
Imports DevExpress.XtraSpreadsheet
' ...
Public Class Form1
Public Sub New()
InitializeComponent()
' Create the Spreadsheet's toolbar menu.
Dim bars As BarManager = spreadsheetControl1.CreateBars()
' Add the Mail Merge bars to the control.
spreadsheetControl1.AddToolbarToMenuManager(SpreadsheetToolbarType.MailMerge)
bars.Form = Me
End Sub
End Class
To create a toolbar menu at design time, select the Create BarManager item in the SpreadsheetControl’s smart tag menu.
You can also use the CreateRibbon method to provide the modern ribbon interface for the SpreadsheetControl.
See Also