CharacterCasing
enum cAlgo.API
DesktopCLICloud
Specifies the case of characters typed manually into a TextBox control.
Definition
public enum CharacterCasing
Namespace: cAlgo.API · Group: Controls
Examples
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)
{
}
}
}
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)
{
"AccessRights": "None",
"TimeZone": "UTC",
"IsOverlay": true
}
Values
| Name | Value | Description |
|---|---|---|
Normal | 0 | Characters typed into a TextBox are not converted. |
Lower | 1 | Characters typed into a TextBox are converted to lowercase. |
Upper | 2 | Characters typed into a TextBox are converted to uppercase. |