TextBox
The TextBox object is used to input a string into Omniview.
Property | Description |
---|---|
AcceptReturn | [FUTURE] |
BorderColor | Color of the box border. |
BorderThickness | Thickness of the box border. |
Fill | Background colour |
FocusColor | Color of the TextBox border when the object is selected. |
Font | Name of the font family to use. See Note on Fonts. |
FontSize | Font size in pixels. Integer value. |
FontStyle | Style of the font. Options:
|
FontWeight | Thickness of the font. Not all options are valid for all fonts. Typical Options:
|
HorizontalScrollEnabled | |
IsReadOnly | Prevents the user from entering text into the TextBox |
IsSecret | Changes all displayed characters to dots. |
MouseOverColor | Color of the border when the mouse is within the object. |
Text | Default text to display |
TextAlignment | A pair of values denoting the horizontal and vertical alignment. E.g. "Top,Right" Horizontal options:
|
TextColor | Color of the text. |
TextWrap | Will automatically wrap text to a new line if the line is greater than the box width. |
VerticalScrollEnabled |
View Example
{
"$type":"TextBox",
"Name":"TextBox",
"Width": 400,
"Height": 50,
"X":"10",
"Y":"20",
"Text": "You can type into this box.",
"TextWrap":"True",
"AcceptReturn":"True",
"FocusColor":"#FF0000",
"Font":"Courier New",
"FontSize":20,
"FontStyle":"Italic",
"FontWeight":"Bold",
"TextColor":"#000080",
"BorderColor":"#000000",
"BorderThickness":3,
"Fill":"#80FF80",
"MouseOverColor":"#800080"
}
Python Example
from Omniview.Python import *
myTextBox = TextBox()
myTextBox.X = 0
myTextBox.Y = 300
myTextBox.Width = 200
myTextBox.Height = 35
myTextBox.Fill = Color("#C0C0C0")
myTextBox.TextAlignment = TextAlignment.Left
Omniview.Windows[0].Content.AddViewObject(myTextBox)