Class

MobileTabPanel


Description

Used to organize controls into groups of tabs that can be selected by the user. Only the controls on the selected tab are visible.

Methods

Name

Parameters

Returns

Shared

AddPanel

caption As String = "", icon As Picture = Nil, container As MobileContainer = Nil

AddPanelAt

index As Integer, caption As String = "", icon As Picture = Nil, container As MobileContainer = Nil

CaptionAt

index As Integer

String

index As Integer, Assigns value As String

ClearFocus

ContainerAt

index As Integer

MobileContainer

index As Integer, Assigns container As MobileContainer

Handle

Ptr

IconAt

index As Integer

Picture

index As Integer, Assigns icon As Picture

Refresh

RemovePanelAt

index As Integer

SetFocus

Events

Name

Parameters

Returns

Closing

Opening

PanelChanged

Property descriptions


MobileTabPanel.AccessibilityHint

AccessibilityHint As String

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 screen."

MobileTabPanel.AccessibilityLabel

AccessibilityLabel As String

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

Me.AccessibilityLabel = "Calculate the value."

MobileTabPanel.Enabled

Enabled As Boolean

Indicates whether the control is enabled or disabled.

Disable the tabpanel:

TabPanel1.Enabled = False

MobileTabPanel.Height

Height As Integer

The height of the control.


MobileTabPanel.LastAddedPanelIndex

LastAddedPanelIndex As Integer

The number of the last panel added with the AddPanel method. LastAddedPanelIndex is zero-based. If there are no panels have been added, LastAddedPanelIndex will be -1.

This property is read-only.


MobileTabPanel.Left

Left As Integer

The left position of the control.


MobileTabPanel.LockBottom

LockBottom As Boolean

Determines whether the bottom edge of the control should stay at a set distance from the bottom edge of the parent control, if there is one, or the owning screen.

This property can be set in the control's Inspector. The following example sets it in code.

Me.LockBottom = True

MobileTabPanel.LockLeft

LockLeft As Boolean

Determines whether the left edge of the control should stay at a set distance from the left edge of the parent control, if there is one, or the owning screen.

LockLeft and Locktop default to True when you add a new control to a screen. Existing controls will be altered only if LockRight and/or LockBottom are not set. LockLeft has no effect unless LockRight is True.

This property can be set in the control's Inspector. The following example sets it in code.

Me.LockLeft = True

MobileTabPanel.LockRight

LockRight As Boolean

Determines whether the right edge of the control should stay at a set distance from the right edge of the parent control, if there is one, or the owning screen.

This property can be set in the control's Inspector. The following example sets it in code.

Me.LockRight = True

MobileTabPanel.LockTop

LockTop As Boolean

Determines whether the top edge of the control should stay at a set distance from the top edge of the parent control, if there is one, or the owning screen.

LockTop and LockLeft default to True when you add a control to a screen. Existing controls will be altered only if LockRight and/or LockBottom are not set. LockTop has no effect unless LockBottom is True.

This property can be set in the control's Inspector. The following example sets it in code.

Me.LockTop = True

MobileTabPanel.Name

Name As String

The name of the control.

This property is read-only.


MobileTabPanel.PanelCount

PanelCount As Integer

The number of tabs in that tabpanel.

This property is read-only.


MobileTabPanel.Parent

Parent As MobileUIControl

The parent (sometimes called a "Super") class of the control.

This property is read-only.


MobileTabPanel.SelectedPanelIndex

SelectedPanelIndex As Integer

The number of the currently selected panel. The first panel is number zero.

To change the panel that is displayed, set this value. Modifying this value calls the PanelChanged event.

This example sets the selects the first tab in the tabpanel:

TabPanel1.SelectedPanelIndex = 0

MobileTabPanel.Top

Top As Integer

The top position of the control.


MobileTabPanel.Visible

Visible As Boolean

Indicates whether the control is visible.

The example makes the tabpanel invisible:

TabPanel1.Visible = False

MobileTabPanel.Width

Width As Integer

The width of the control.

Method descriptions


MobileTabPanel.AddPanel

AddPanel(caption As String = "", icon As Picture = Nil, container As MobileContainer = Nil)

Adds a panel after the last panel of the TabPanel and uses the passed string as its caption.

Add a tab called "Extra" to the TabPanel:

TabPanel1.AddPanel("Extra")

MobileTabPanel.AddPanelAt

AddPanelAt(index As Integer, caption As String = "", icon As Picture = Nil, container As MobileContainer = Nil)

Adds a panel at the index passed and uses the passed string as its caption.

Add a tab called "Extra" to the TabPanel at index 3:

TabPanel1.AddPanelAt(3, "Extra")

MobileTabPanel.CaptionAt

CaptionAt(index As Integer) As String

Gets the caption of the tab at the index passed.


CaptionAt(index As Integer, Assigns value As String)

Sets the caption of the tab at the index passed.


MobileTabPanel.ClearFocus

ClearFocus

Removes the focus from the control.

TextField1.ClearFocus

MobileTabPanel.ContainerAt

ContainerAt(index As Integer) As MobileContainer

Gets the container control for the tab at the index passed.


ContainerAt(index As Integer, Assigns container As MobileContainer)

Sets the container control of the tab at the index passed.


MobileTabPanel.Handle

Handle As Ptr

The handle to the underlying native OS control.


MobileTabPanel.IconAt

IconAt(index As Integer) As Picture

Gets the icon for the tab at the index passed.


IconAt(index As Integer, Assigns icon As Picture)

Sets the icon of the tab at the index passed.


MobileTabPanel.Refresh

Refresh

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

Call Refresh to force a Canvas to redraw itself:

TabPanel1.Refresh

MobileTabPanel.RemovePanelAt

RemovePanelAt(index As Integer)

Removes the panel at the index passed.


MobileTabPanel.SetFocus

SetFocus

If applicable, sets the focus to the control. KeyDown events are directed to the control.

If the control cannot get the focus, SetFocus does nothing.

The following example in the Opening event sets the focus to the that control. If another control has the focus when this line is executed, then the user sees this control gets the focus.

Me.SetFocus

Event descriptions


MobileTabPanel.Closing

Closing

Called when the control's layout is closing.


MobileTabPanel.Opening

Opening

Called when the control's layout is opening.

This is where you typically put initialization code.


MobileTabPanel.PanelChanged

PanelChanged

The frontmost panel has changed and can be determined using the SelectedPanelIndex property.

This is also called when the user changes the selected tab in a MobileTabPanel.

Notes

Setting the captions and icons for tabs

To set the name and icons of each tab:

  1. In the Layout Editor, select your MobileTabPanel.

  2. In the Tab Panel section of the Inspector, click the Edit button.

  3. In the dialog box that appears, set these values using the Caption and Icon columns.

Adding controls to a specific tab

To add controls to a specific tab of a MobileTabPanel:

  1. Add a MobileContainer control to your project then add controls to it.

  2. In the Layout Editor, select your MobileTabPanel.

  3. In the Tab Panel section of the Inspector, click the Edit button.

  4. Set the container column for the tab you want to the MobileContainer you just added.

Compatibility

Android projects on the Android operating system.

See also

MobileControl parent class