---
id: "T:cAlgo.API.CharacterCasing"
kind: "enum"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Controls/CharacterCasing/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# CharacterCasing (enum)

Specifies the case of characters typed manually into a TextBox control.

Environments: Desktop supported · CLI supported · Cloud supported.

## Definition

```csharp
public enum CharacterCasing
```

## Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo
{
    // This indicator shows how to use CharacterCasing on text box controls
    public partial class CharacterCasingSample : Indicator
    {
        protected override void Initialize()
        {
            var stackPanel = new StackPanel
            {
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment = VerticalAlignment.Center,
                BackgroundColor = Color.Gold,
                Opacity = 0.6,
                Width = 200
            };

            stackPanel.AddChild(new TextBlock
            {
                Text = "Lower Character Casing",
                Margin = new Thickness(10, 10, 10, 0),
                ForegroundColor = Color.Red,
                FontWeight = FontWeight.ExtraBold
            });

            stackPanel.AddChild(new TextBox
            {
                CharacterCasing = CharacterCasing.Lower,
                Margin = 10
            });

            stackPanel.AddChild(new TextBlock
            {
                Text = "Upper Character Casing",
                Margin = new Thickness(10, 10, 10, 0),
                ForegroundColor = Color.Red,
                FontWeight = FontWeight.ExtraBold
            });

            stackPanel.AddChild(new TextBox
            {
                CharacterCasing = CharacterCasing.Upper,
                Margin = 10
            });

            stackPanel.AddChild(new TextBlock
            {
                Text = "Normal Character Casing",
                Margin = new Thickness(10, 10, 10, 0),
                ForegroundColor = Color.Red,
                FontWeight = FontWeight.ExtraBold
            });

            stackPanel.AddChild(new TextBox
            {
                CharacterCasing = CharacterCasing.Normal,
                Margin = 10
            });

            Chart.AddControl(stackPanel);
        }

        public override void Calculate(int index)
        {
        }
    }
}
```

Python:

```python
import clr
clr.AddReference("cAlgo.API")

from cAlgo.API import *

class Test():
    def get_text_block(self, text):
        textBlock = TextBlock()
        textBlock.Text = text
        textBlock.ForegroundColor = Color.Red
        textBlock.FontWeight = FontWeight.ExtraBold
        textBlock.Margin = Thickness(10, 10, 10, 0)
        return textBlock

    def get_text_box(self, characterCasing):
        textBox = TextBox()
        textBox.CharacterCasing = characterCasing
        textBox.Margin = Thickness(10)
        return textBox

    def initialize(self):
        stackPanel = StackPanel()
        stackPanel.HorizontalAlignment = HorizontalAlignment.Center
        stackPanel.VerticalAlignment = VerticalAlignment.Center
        stackPanel.BackgroundColor = Color.Gold
        stackPanel.Opacity = 0.6
        stackPanel.Width = 200

        stackPanel.AddChild(self.get_text_block("Lower Character Casing"))
        stackPanel.AddChild(self.get_text_box(CharacterCasing.Lower))
        stackPanel.AddChild(self.get_text_block("Upper Character Casing"))
        stackPanel.AddChild(self.get_text_box(CharacterCasing.Upper))
        stackPanel.AddChild(self.get_text_block("Normal Character Casing"))
        stackPanel.AddChild(self.get_text_box(CharacterCasing.Normal))

        api.Chart.AddControl(stackPanel)
```

config.json:

```json
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true
}
```

## Values

- `CharacterCasing.Normal` — Characters typed into a TextBox are not converted.
- `CharacterCasing.Lower` — Characters typed into a TextBox are converted to lowercase.
- `CharacterCasing.Upper` — Characters typed into a TextBox are converted to uppercase.

