TextBox

Parent Previous Next

TextBox

The TextBox object allows the user to display strings (text or Tags), and change them in real time.



To create a new TextBox in the Graphics Document:


.     Click the "TextBox" button in the Ribbon.

.     Place the mouse pointer where you want to create the TextBox.

.     Click to create the new TextBox.




Example 1: Changing TextBox content using scripts.


.     Create a new Graphic.

.     Insert a TextBox.

.     Give it a name and remember it. It will be used later.


graphic


.     Configure the Text property of TextBox1 using a string Tag.


graphic


.     Create a button with the following configuration:

.     Using the Script Properties, write the following code in the MouseUp script:


graphic


.     Change the Text property in order to show the value of the tag.


graphic

            


.     Run the application (F5)  and see the results.




Now, everything you write in TextBox1 will modify the value of the Tag.


graphic         



Also, every time the button is pressed, the value of the tag will change to "Default", and that will be shown in TextBox1.


graphic



Example 2: Changing text colour dynamically.


.     In this example, we are going to create a TextBox showing text which will change color depending on its value.

.     Create a TextBox object and configure it as seen in Example 1 (above).

.     Create an integer Tag @Value and use it in the TextBox's Text property.

.     Select TextBox1 and open its Brushes properties.

.     Select Foreground Color and then Dyn (Dynamic).

.      Configure the Dynamic color property as in the next figure:


graphic


             If @Value is less than 10, the text will become red. Otherwise it will become green.



.     Run the application (F5) and see the results.




Now, lets write any value into TextBox1. Depending on that value, the text will be green (value > 10) or red (value =< 10).


graphic        graphic



Property List:


Info

.    Name

.    Size

.    Location

.    ZIndex

.    Draggable


Configuration

.    Angle

.    Text

.    Text Font

.    Password

.    Text Wrapping

.    Text Alignment

.    Select text on focus

.    Corner Radius

.    Number of Decimals

.    HotKey

.    Is Enabled

.    Is Visible

.    ToolTip


Functions

.    .FontColor

.    .Text

.    .ResetPasswordBox()

.    .GetFocus()

.    .SelectAll()


Script

.    MouseDoubleClick

.    MouseDown

.    MouseRightUp

.    MouseRightDown

.    MouseUp

.    MouseWhile


Brushes

.    Background

.    Foreground


Security

.    Can Do Action