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.


Pressed - Most often, you use the Pressed 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 Pressed 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 Pressed event handler and the toolbar event handler.


Caption - Button text can be changed using the Caption property.


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


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 appropriate button and menu event handlers.

See Also

WebButton class