Spread for ASP.NET 9.0 Product Documentation > Developer's Guide > Customizing User Interaction > Customizing the Toolbars > Customizing the Command Bar on the Component |
The command bar is a tool bar that is displayed at the top or bottom of the component. This bar includes the sheet name tabs (if there is more than one sheet) and the command buttons. By default, page navigation aids are also displayed on the command bar but can be repositioned or not displayed on the command bar.
The customizations are made possible with the CommandBarInfo object. You can do the following customizations:
To set the color of the command bar, use the BackColor property. To change the font of the text that appears in the buttons, use the Font property.
To hide the command bar when there is only one sheet (and thus no sheet name tabs to display), use the Visible property.
By default, the command bar is displayed at the bottom of the component. You can display it at the top by setting the CommandBarOnBottom property in the FpSpread class.
Command Bar Position | Example Spread |
---|---|
On Top |
|
On Bottom |
Several, but not all, of the buttons in the command bar trigger a postback to the server. These include:
For information on other aspects of the appearance of the command bar buttons, refer to Customizing the Command Buttons.
Use the properties of the FpSpread class to define the position of the command bar and use the command bar properties to customize the look of the command bar.
In this example, set the command bar to display at the top of the component and set the color to yellow.
C# |
Copy Code
|
---|---|
FpSpread1.CommandBarOnBottom = false; FpSpread1.CommandBar.Background = null; FpSpread1.CommandBar.BackColor = Color.Yellow; |
VB |
Copy Code
|
---|---|
FpSpread1.CommandBarOnBottom = False FpSpread1.CommandBar.Background = Nothing FpSpread1.CommandBar.BackColor = Color.Yellow |