# RulerBar.Colors Class

> The RulerBar.Colors class gets, sets or resets the display colors of a Windows Forms RulerBar control. By default the display colors depend on sytem colors. With this class all colors can be individually designed. The colors are only used when the ruler bar's BorderStyle property has been set to ColorScheme.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 15.1
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.Windows.Forms.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Windows.Forms.dll` from the setup
- **Inherits:** `TXTextControl.ColorBase`
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > RulerBar.Colors Class
- **1134 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar-colors/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar-colors/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar-colors/llms-full.txt

---

### Description

The RulerBar.Colors class gets, sets or resets the display colors of a Windows Forms [RulerBar](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/llms-full.txt) control. By default the display colors depend on sytem colors. With this class all colors can be individually designed. The colors are only used when the ruler bar's [BorderStyle](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/borderstyle-property/llms-full.txt) property has been set to `ColorScheme`.

### Syntax

```csharp
public sealed class RulerBar.Colors : ColorBase
```

```vbnet
Public NotInheritable Class RulerBar.Colors
    Inherits ColorBase
```

### Examples

The following example creates a Colors instance and configures its fore color setting for a document workflow.

```csharp
RulerBar.Colors colors = new();
colors.ForeColor = System.Drawing.Color.LightSteelBlue;
```

```vbnet
Dim colors As New RulerBar.Colors()
colors.ForeColor = System.Drawing.Color.LightSteelBlue
```

---

## In This Section

- [RulerBar.Colors.BackColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar-colors/backcolor-property/llms-full.txt): Gets or sets the background color at the left or top edge of the ruler bar.
- [RulerBar.Colors Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar-colors/constructor/llms-full.txt): Initializes a new instance of the RulerBar.Colors class. After creating the object with this constuctor, individual colors can be set. If the Colors object is assigned to the RulerBar.DisplayColors property, non-set colors are reset to their system dependent default values.
- [RulerBar.Colors.ForeColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar-colors/forecolor-property/llms-full.txt): Gets or sets the color used for the numbers of the ruler.
- [RulerBar.Colors.GradientBackColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar-colors/gradientbackcolor-property/llms-full.txt): Gets or sets the background color at the right or bottom edge of the ruler bar.
- [RulerBar.Colors.ResetBackColor Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar-colors/resetbackcolor-method/llms-full.txt): Resets the ruler bar's BackColor to its system dependent default value.
- [RulerBar.Colors.ResetForeColor Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar-colors/resetforecolor-method/llms-full.txt): Resets the ruler bar's ForeColor to its system dependent default value.
- [RulerBar.Colors.ResetGradientBackColor Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar-colors/resetgradientbackcolor-method/llms-full.txt): Resets the ruler bar's GradientBackColor to its system dependent default value.
- [RulerBar.Colors.ResetRulerColor Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar-colors/resetrulercolor-method/llms-full.txt): Resets the ruler bar's RulerColor to its system dependent default value.
- [RulerBar.Colors.ResetSeparatorColorDark Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar-colors/resetseparatorcolordark-method/llms-full.txt): Resets the ruler bar's SeparatorColorDark to its system dependent default value.
- [RulerBar.Colors.ResetSeparatorColorLight Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar-colors/resetseparatorcolorlight-method/llms-full.txt): Resets the ruler bar's SeparatorColorLight to its system dependent default value.
- [RulerBar.Colors.RulerColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar-colors/rulercolor-property/llms-full.txt): Gets or sets the color of the ruler.
- [RulerBar.Colors.SeparatorColorDark Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar-colors/separatorcolordark-property/llms-full.txt): Gets or sets the color of dark separators.
- [RulerBar.Colors.SeparatorColorLight Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar-colors/separatorcolorlight-property/llms-full.txt): Gets or sets the color of light separators.

---

## Nearby

- **Previous:** [RulerBar.BorderStyle Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/borderstyle-property/llms-full.txt)
- **Next:** [RulerBar.Colors.BackColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar-colors/backcolor-property/llms-full.txt)
