Class

iOSButton


Warning

This item was deprecated in version 2020r2. Please use MobileButton as a replacement.

Description

This is the standard Button control for iOS.

Events

Name

Parameters

Returns

Action

Close

Open

Property descriptions


iOSButton.AccessibilityHint

AccessibilityHint As Text

The accessibility hint is a longer description that is read aloud when VoiceOver is enabled.

Me.AccessibilityHint = "Click to calculate the value and display the next view."

iOSButton.AccessibilityLabel

AccessibilityLabel As Text

The accessibility label of of a control is a short name that is read aloud when VoiceOver is enabled.

Me.AccessibilityLabel = "Calculate the value."

iOSButton.Caption

Caption As Text

Gets or sets the caption for the Button.

Change the caption:

Me.Caption = "Save"

iOSButton.Enabled

Enabled As Boolean

Indicates whether the control is enabled or disabled.

Disable the button:

Button1.Enabled = False

iOSButton.Height

Height As Double

The height of the control.

This property is read-only.


iOSButton.Left

Left As Double

The left position of the control.

This property is read-only.


iOSButton.Name

Name As Text

The name of the control. This can only be set in the Inspector. Use the name to refer to the control.

This property is read-only.


iOSButton.Parent

Parent As iOSControl

Indicates the control's parent object, if it has one. If there is no parent, this is Nil.

This property is read-only.


iOSButton.TextColor

TextColor As Color

The color to display the Caption text.

Change the Caption text color to red:

Button1.TextColor = Color.Red

iOSButton.TextFont

TextFont As iOSFont

The font use for displaying the Caption.

Change the button font and text size:

Button1.TextFont = iOSFont.ItalicSystemFont
Label1.TextFont = iOSFont.SystemFont(32)

iOSButton.Top

Top As Double

The top position of the control.

This property is read-only.


iOSButton.Visible

Visible As Boolean

Indicates whether the control is visible.

Make a button invisible:

Button1.Visible = False

iOSButton.Width

Width As Double

The width of the control.

This property is read-only.

Method descriptions


iOSButton.AddConstraint

AddConstraint(constraint As iOSLayoutConstraint)

Adds a constraint to the control. This constraint is used by child controls that have been added to this control.


iOSButton.AddControl

AddControl(child As MobileControl)

Adds a child control to the control.


iOSButton.Control

Control(index As Integer) As MobileControl

Gets the child control at the specified index.


iOSButton.ControlCount

ControlCount As Integer

The number of child controls in the control.


iOSButton.Handle

Handle As Ptr

The handle is used to get a reference to the control for interfacing directly with the iOS API.


iOSButton.Invalidate

Invalidate

Marks the control so that it will be redrawn during the next event loop.

Call Invalidate to force a Canvas to redraw itself:

Canvas1.Invalidate

iOSButton.RemoveConstraint

RemoveConstraint(constraint As iOSLayoutConstraint)

Removes a constraint from the control.


iOSButton.RemoveControl

RemoveControl(child As MobileControl)

Removes the control from the control.


iOSButton.SetTintColor

SetTintColor(value As Color)

Changes a control's tint color. This varies by control and for some controls may not do anything. For example, with an MobileTextField this changes the cursor color.

Event descriptions


iOSButton.Action

Action

The Action event handler is called when the button is pressed, tapped, clicked, etc.

Change Label Text when a Button is pressed:

Label1.Text = "You pressed the button."

iOSButton.Close

Close

Called when the control is removed from its container, such as a view.


iOSButton.Open

Open

Called after the control is created. This is where you typically put initialization code.

Set label text in Open event:

Me.Text = "Hello"

Compatibility

iOS projects on the iOS operating system.

See also

MobileControl parent class; Font class, MobileSegmentedButton control