Using Buttons

In this section:

How to:

A button is a control that triggers an action when clicked.

For an example of how you can use a button, see the WebFOCUS Maintain Getting Started manual.


Top of page

x
Procedure: How to Place a Button on Your Form
  1. Select the Button control in the Controls palette.
  2. Draw a rectangle on your form approximately where you want your button 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.) If you want the text to appear on more than one line, press Shift+Enter between each line.
  4. (Optional, but recommended.) Give your button a more meaningful name than Buttonn.
  5. If necessary, readjust the size and placement of your button.

    Note: If you click on the text of a button, you will be in text editing mode (when the text jumps to the top of the button and is selected). If you click near the edges of the button, you will be in move/resize mode. To change to a different mode, deselect the button and select it again.

  6. Assign a Click action to your button using the Event Handler editor.

    Tip: You can easily open the Event Handler editor with your button selected by double-clicking the button.

    For more information on assigning actions to events, see Defining Events and Event Handlers.


Top of page

x
Changing Button Properties

When you select your button, you will see a list of button properties in the property sheet. Changing these properties will change what your button looks like and what it does at run time.

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 displayed in the button?

the Text Property property.

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

the (Name) Property property.

to change the size or location of the button?

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

a style sheet.

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

to change the color of the button?

the BackColor Property property to determine what color the button is.

the ForeColor Property property to determine the color of the text in the label.

a style sheet.

to change the text font?

the Font Property property.

a style sheet.

to make the button inactive or make it invisible?

the Enabled Property property to determine whether the button is active or not. (If the button 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 button is visible to the end user.

a style sheet.

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

the CursorPointer Property property.

a style sheet.

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

the ToolTipText Property property.

to assign a help topic to the button?

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

the end user to be able to tab to the button?

the Tabstop Property property.

to make the event handler for clicking the button occur when the end user presses Enter?

the DefaultButton Property property.

to move the button to another layer?

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

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

the ZIndex Property.

Note: IE7 or equivalent required.


WebFOCUS