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 A text button 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.

Do you want...

Then use...

to change the text?

the Text Property property. (You can also select the text and change it directly on the form.)

to change the name of the text that identifies it to the procedure?

the (Name) Property property.

to change the size or location of the text control?

the Bottom Property, Left Property, Right Property, and Top Property properties.

a style sheet.

(You can also move or resize the text directly in the form.)

to change the color of the text?

the BackColor Property property to determine the background color.

the ForeColor Property 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 end user's browser settings to determine the color of the text.

a style sheet.

to change the text font?

the Font Property property.

a style sheet.

to change the text alignment (left-justified, centered, right-justified)?

the Alignment Property property.

a style sheet.

to display a tool tip when the cursor is on top of the text?

the ToolTipText Property property.

to assign a help topic to the text?

the Help property. For more information, see Assigning Help to Your Forms and Controls.

to add a border to the text?

the Border Property property to determine whether you have a border.

the BorderColor Property property to determine the color of the border.

the BorderWidth Property property to determine the width of the border.

a style sheet.

to make the text inactive or make it invisible?

the Enabled Property property to determine whether the text is active or not. (If the text is inactive, it will be grayed out and nothing will happen when the end user clicks it.)

the Visible Property property to determine whether the text is visible to the end user.

a style sheet.

to change what the cursor looks like when it is on top of the text?

the CursorPointer Property property.

a style sheet.

to move the text to another layer?

the Layer property. For more information, see Layering Controls.

to control the display order of the text when more than one control is overlaid?

the ZIndex Property.

Note: IE7 or equivalent required.



x
Using Text Controls as Hyperlinks

How to:

One common use for text controls is as 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