# General Style of the Sheet Corner

Explore examples of customizing the sheet corner style, including setting background colors, borders, and incorporating images, to create visually appealing sheet corners for your spreadsheets.

## Content

Sheet corners can display grid lines, have a different background color from the rest of the headers, and more. There are several different ways to set properties in the sheet corner. One way is with the [SheetCorner](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetCorner.html) class. Another option is to set the sheet corner properties for the [SheetView](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.html) class. In the following figure, the sheet corner is displayed with a two-pixel wide, green border and a light blue background.
![Example of a Sheet Corner](https://cdn.mescius.io/document-site-files/images/2238e618-a1fb-45a6-9ce5-9a4157bd2931/images/sheetcorner_blue.png)
The sheet corner supports right-to-left orientation. When you set Right-to-Left mode in Spread for the entire spreadsheet, the sheet corner also displays with right-to-left orientation as well.

## General Customization

Several of the properties of a [StyleInfo](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.StyleInfo.html) class can be set for the sheet corner cell. These properties include:

| **Property** | **Description** |
| -------- | ----------- |
| [Border](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.StyleInfo.Border.html) | The border around the cell |
| [CellType](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.StyleInfo.CellType.html) | The type of cell |
| [HorizontalAlignment](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.StyleInfo.HorizontalAlignment.html) and [VerticalAlignment](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.StyleInfo.VerticalAlignment.html) | The alignment of text in the cell (horizontal and vertical) |

Using SheetCorner class
The following figure displays a sheet corner that has been customized with the [SheetCorner](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetCorner.html) class.
![Example of a Sheet Corner](https://cdn.mescius.io/document-site-files/images/2238e618-a1fb-45a6-9ce5-9a4157bd2931/images/sheetcornerclass.png)
The following sections provide instructions and example code for customizing many aspects of the sheet corner.

## Using Code

You can set the sheet corner style using the properties of the [SheetCorner](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetCorner.html) class.
**Example**
This example code sets the background color, sets borders, puts text in a cell, and sets the row and column count.

```csharp
fpSpread1.ActiveSheet.SheetCorner.DefaultStyle.Renderer = new FarPoint.Win.Spread.CellType.CornerRenderer();
fpSpread1.ActiveSheet.AllowTableCorner = true;
fpSpread1.ActiveSheet.SheetCorner.RowCount = 6;
fpSpread1.ActiveSheet.SheetCorner.ColumnCount = 6;
fpSpread1.ActiveSheet.SheetCorner.AlternatingRows[0].BackColor = Color.Violet;
fpSpread1.ActiveSheet.SheetCorner.Cells[0, 0].Text = "Test";
fpSpread1.ActiveSheet.SheetCorner.Columns[0].Border = new FarPoint.Win.LineBorder(Color.Green);
fpSpread1.ActiveSheet.SheetCorner.Rows[0].Border = new FarPoint.Win.LineBorder(Color.Green);
fpSpread1.ActiveSheet.SheetCorner.HorizontalGridLine = new FarPoint.Win.Spread.GridLine(FarPoint.Win.Spread.GridLineType.None);
fpSpread1.ActiveSheet.SheetCorner.VerticalGridLine = new FarPoint.Win.Spread.GridLine(FarPoint.Win.Spread.GridLineType.None);
fpSpread1.ActiveSheet.SheetCorner.DefaultStyle.VisualStyles = FarPoint.Win.VisualStyles.Off;
```

```vbnet
fpSpread1.ActiveSheet.SheetCorner.DefaultStyle.Renderer = New FarPoint.Win.Spread.CellType.CornerRenderer
fpSpread1.ActiveSheet.AllowTableCorner = True
fpSpread1.ActiveSheet.SheetCorner.RowCount = 6
fpSpread1.ActiveSheet.SheetCorner.ColumnCount = 6
fpSpread1.ActiveSheet.SheetCorner.AlternatingRows(0).BackColor = Color.Violet
fpSpread1.ActiveSheet.SheetCorner.Cells(0, 0).Text = "Test"
fpSpread1.ActiveSheet.SheetCorner.Columns(0).Border = New FarPoint.Win.LineBorder(Color.Green)
fpSpread1.ActiveSheet.SheetCorner.Rows(0).Border = New FarPoint.Win.LineBorder(Color.Green)
fpSpread1.ActiveSheet.SheetCorner.HorizontalGridLine = New FarPoint.Win.Spread.GridLine(FarPoint.Win.Spread.GridLineType.None)
fpSpread1.ActiveSheet.SheetCorner.VerticalGridLine = New FarPoint.Win.Spread.GridLine(FarPoint.Win.Spread.GridLineType.None)
fpSpread1.ActiveSheet.SheetCorner.DefaultStyle.VisualStyles = FarPoint.Win.VisualStyles.Off
```

## Using SheetView class

### Customizing the Corner Color

You can set the sheet corner style by using the [SheetCornerStyle](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.SheetCornerStyle.html) property of the [SheetView](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.html) object to specify individual properties of the sheet corner (as in the following example). You can also specify the grid lines around the sheet corner using the [SheetCornerHorizontalGridLine](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.SheetCornerHorizontalGridLine.html) and [SheetCornerVerticalGridLine](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.SheetCornerVerticalGridLine.html) properties.
**Example**
This example code sets the background color to light blue and sets the border as shown in the figure.

```csharp
fpSpread1.ActiveSheet.ColumnHeader.RowCount = 3;
fpSpread1.ActiveSheet.RowHeader.ColumnCount = 3;
fpSpread1.ActiveSheet.SheetCorner.DefaultStyle.Renderer = new FarPoint.Win.Spread.CellType.CornerRenderer();
fpSpread1.ActiveSheet.SheetCornerStyle.BackColor = Color.LightBlue;
fpSpread1.ActiveSheet.SheetCornerStyle.Border = new FarPoint.Win.LineBorder(Color.Green, 2);
```

```vbnet
fpSpread1.ActiveSheet.ColumnHeader.RowCount = 3
fpSpread1.ActiveSheet.RowHeader.ColumnCount = 3
fpSpread1.ActiveSheet.SheetCorner.DefaultStyle.Renderer = New FarPoint.Win.Spread.CellType.CornerRenderer
fpSpread1.ActiveSheet.SheetCornerStyle.BackColor = Color.LightBlue
fpSpread1.ActiveSheet.SheetCornerStyle.Border = New FarPoint.Win.LineBorder(Color.Green, 2)
```

### Customizing the Corner Image

You can place a graphic in the sheet corner by setting a background image to a cell type and assigning that cell type to the sheet corner, which is just a cell. Then, specify a particular graphic file for the image (Picture object).
**Example**
This example code sets the background image of a cell type and assigns that cell type to the sheet corner.

```csharp
FarPoint.Win.Spread.CellType.GeneralCellType gencell = new FarPoint.Win.Spread.CellType.GeneralCellType();
FarPoint.Win.Picture cornerimage = new FarPoint.Win.Picture(Image.FromFile("D:\\images\\logocorner.jpg"));
gencell.BackgroundImage = cornerimage;
fpSpread1.ActiveSheet.SheetCornerStyle.CellType = gencell;
```

```vbnet
Dim gencell As New FarPoint.Win.Spread.CellType.GeneralCellType
Dim cornerimage As New FarPoint.Win.Picture(Image.FromFile("D:\images\logocorner.jpg"))
gencell.BackgroundImage = cornerimage
FpSpread1.ActiveSheet.SheetCornerStyle.CellType = gencell
```

## See Also

[Text Display in the Sheet Corner](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-header/spwin-sheetcorner/spwin-sheetcorner-text)
[Table Display in the Sheet Corner](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-header/spwin-sheetcorner/spwin-sheetcorner-table)
[Customizable Cell in the Sheet Corner](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-header/spwin-sheetcorner/spwin-sheetcorner-custcells)
[Cell Spans in the Sheet Corner](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-header/spwin-sheetcorner/spwin-sheetcorner-spans)
[Header Count Synchronization in the Sheet Corner](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-header/spwin-sheetcorner/spwin-sheetcorner-headercount)
[Drawing (Rendering) Style](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-header/spwin-sheetcorner/spwin-sheetcorner-renderstyle)