Using Text

In this section:

How to:

The text control enables you to add static text areas to a form.


Top of page

x
Procedure: How to Place Text on Your Form
  1. Select the Text control Text control in the Controls palette.
  2. Draw a rectangle on your form approximately where you want your text block to be at approximately the size you want.
  3. Type the text you want your button to have and press Enter. (The text should be selected automatically when you created the button.) To move to the next line, press Shift+Enter.
  4. If necessary, readjust the size and placement of your text.

Top of page

x
Changing Text Properties

When you select your text, you will see a list of text properties in the property sheet. Changing these properties will change what your text looks like.

Many of the styling properties can also be changed using a Cascading Style Sheet. For more information on Cascading Style Sheets, see Using Cascading Style Sheets.

Choose your property based on the task you wish to perform:

If you want to change the text, use the Text Property. You can also select the text and change it directly on the form.

If you want to change the name of the text that identifies it to the procedure, use the (Name) Property. For more information, see the (Name) Property.

If you want to change the size of the location or size of the text control, use a style sheet or resize the text directly in the form. You can also use the Bottom Property, Left Property, Right Property, and Top Property.

If you want to change the color of the text, use a style sheet or the ForeColor Property to determine the color of the text. If your text control has an event handler assigned to its Click event, the Hyperlink property uses the browser settings of the end user to determine the color of the text. Use the BackColor Property to determine the background color.

If you want to change the text font, use a style sheet or use the Font Property.

If you want to change the text alignment to left-justified, centered, or right-justified, use a style sheet or the Alignment Property.

If you want to display a tooltip when the cursor is on the top of the text, use the ToolTipText Property.

If you want to assign a Help topic to the text, use the Help Property. For more information, see Assigning Help to Your Forms and Controls.

If you want to add a border to the text, use a style sheet, the Border Property to determine whether you have a border, the BorderColor Property to determine the color of the border, and the BorderWidth Property to determine the width of the border.

If you want to make the text inactive or make it invisible, use the Enabled Property to determine whether the text are active or not. If the text is inactive, nothing will happen when the end user clicks it. You can also use the Visible Property to determine whether the text is visible to the end user or use a style sheet. For more information, see the Enabled Property and the Visible Property.

If you want to change what the cursor looks like when it is on top of the text, use the CursorPointer Property or use a style sheet.

If you want to move the text to another layer, use the Layer Property. For more information, see Layering Controls.

If you want to control the display order of the text when more than one control is overlaid, use the ZIndex Property. For more information, see the ZIndex Property.


Top of page

x
Using Text Controls as Hyperlinks

How to:

One common use for text controls is in hyperlinks. Usually, hyperlinks are distinguished from other text by being underlined and a different color. Also, when you move your cursor on top of them, it turns into a hand.



x
Procedure: How to Turn Your Text Control Into a Hyperlink
  1. Open the Event Handler editor for your text control and select the Click event.
  2. Assign an event handler to your control (usually, a web link).
  3. Close the Event Handler editor.
  4. Change the Hyperlink property to 1 - Yes.

Note: You must have an event handler assigned to the Click event for the text control, or the hyperlink will not show up.


WebFOCUS