UserGuide

Web Button

From Xojo Documentation

The Button is implemented as a native browser control. By default, the button appearance is determined by the defaults for the browser and OS it is running on.

Buttons are typically used to evoke an action.

The Set Default Value feature can be used to quickly change the caption.

Below is a list of commonly used events and properties. Refer to WebButton in the Language Reference for the complete list.

Events

Action

Most often, you use the Action event handler of the button. In this event handler you put the code that should do something when the button is pressed. If the code in the Action event handler should be called by other means (e.g. a toolbar), then you should move the code to a method of the web page and instead call the method from the Button Action event handler and the toolbar event handler.

Properties

Caption

Button text can be changed using the Caption property.

Usage

You can put the code that should run when the button is pressed in the Action event handler. This code displays a simple message when a button is pressed:

MsgBox("Hello!")

If your code needs to be called from multiple places (say a button press and a menu), then put the code in its own method and then call the method from the button and menu Action event handlers.

See Also

WebButton class; UserGuide:Web UI topic