Where minds and technology meet.
Search Site GrapeCity Portal Home
 »Input Pro  » Product Tour  » fpText Control jump to:

fpText Control

   The fpText control is a formatted edit control that formats and displays text (string data) up to 255 characters long. The fpText control provides special features for formatting, displaying, and validating text, and you can restrict the characters the user can type in the control. You can also add buttons to the fpText control to customize user interaction and it supports the IntelliMouse® by allowing the user to scroll text in the control.

Automatically Changing Text Case | Creating a Password Field | Customizing User Entry | Providing Buttons | Displaying Multiple Lines of Text | Validating Text Data | Working with Access Keys

  Back to Top
 Automatically Changing Text Case
   You can specify that text automatically change to a particular case, such as uppercase, using the AutoCase property.

The case can be changed to one of the following choices:
    * Uppercase
 * Lowercase
 * Upper and lower case with the first letter of each word capitalized
 * Upper and lowercase with the first letter of each word capitalized, but allowing the user to type uppercase characters

 Back to Top
 Creating a Password Field
   You can use the fpText control to create a password field that hides each character with a masking character as the user types the password by setting the PasswordChar property. When you create a password field and write code to handle the password, you can restrict user access to a database, a form, or an object.

The fpText control provides a simple format for creating a password field. If you want to create a password field that further limits character entry, you might want to consider using the fpMask control.

  Back to Top
 Customizing User Entry
   The fpText control accepts all characters, including numbers, letters, and symbols. The fpText control handles numbers, letters, and symbols as character data.

You can restrict the valid characters by setting the CharValidationText property. For example, if you set the CharValidationText property to "ABCD", the user can type only those four characters, but both of the strings "AABBCADDB" and "BBCC" are valid. The CharValidationText property is case sensitive. Unlike the fpMask control, the fpText control does not require that the valid characters be in a certain position.

You can use the MaxLength property to specify the maximum number of characters allowed in the control. The user cannot provide text strings longer than the specified maximum number of characters. By default, if a text string longer than the maximum limit is supplied, a UserError event occurs.

  Back to Top
 Providing Buttons
   The fpText control can display buttons to let the user move through long strings of text. A commonly used button style for the fpText control is the slide button. By default, slide buttons move through the text to either the right or the left. You can specify the number of characters to shift the text.

 Back to Top
 Displaying Multiple Lines of Text
   You can specify whether the control displays multiple lines of text by setting the MultiLine property. To assist navigation, the control can display a vertical scroll bar by setting the ScrollV property. The following figure shows an fpText control that displays multiple lines and a scroll bar.

  Back to Top
 Validating Text Data
NOTE: Be sure to read the Customizing User Entry section above for information on validation of data while being entered by the user.

   When the fpText control loses the focus, it checks the contents of the control to see whether they are valid. You can use the MaxLength property to specify the maximum number of characters allowed in the control. Any string provided from a database or in code that is longer than the maximum length is considered invalid.

You can change the fpText control’s appearance to reflect that it has received invalid data. In addition, you can specify whether and how invalid data is displayed.

You can specify whether the control allows the Null value. If the control allows the Null value as a valid value, the control is blank when it contains the Null value, and it displays as its background color the color specified by the NullColor property. Otherwise, the control displays an empty string.

  Back to Top
 Working with Access Keys
   Access keys let the user move the focus to a control by pressing the Alt key and a character key, for example, Alt+F. Static fpText controls cannot receive the focus and do not provide access key capability; however, they can display the appearance of having an access key and you can provide code that creates an access key.

Access keys are underlined. Specify the character to underline in the fpText control by putting an ampersand (&) in front of the character in the text. You can use ampersand characters in static controls without underlining the following character by setting the NoPrefix property to True.