Spread for ASP.NET 12 Product Documentation
Hiding a Specific Command Button
Spread for ASP.NET 12 Product Documentation > Developer's Guide > Customizing User Interaction > Customizing the Toolbars > Hiding a Specific Command Button

You can customize the display of the command buttons in the command bar by hiding any or all of the command buttons.

To hide a command button, set the Visible property to false in the event that creates the button.

Using Code

Use the CreateButton event to hide certain buttons.

Example

This example uses code to hide the print icon by adding the Visible property to the CreateButton event. The result is shown in this figure.

Command buttons without the Print button

C#
Copy Code
private void FpSpread1_CreateButton(object sender, FarPoint.Web.Spread.CreateButtonEventArgs e)
{
    if (e.Command == "Print")
    {
        e.Visible = false;
    }
} 
VB
Copy Code
Private Sub FpSpread1CreateButton(ByVal sender As Object, ByVal e As FarPoint.Web.Spread.CreateButtonEventArgs) Handles FpSpread1.CreateButton
If e.Command = "Print" Then
e.Visible = False
End If
End Sub