Control appearance and behavior of tab group
The properties listed here are valid for tab groups in GUIDE or
in apps created with the
figure function. If you are
using App Designer or the
uifigure function, see TabGroup Properties instead. For more information, see GUIDE Migration Strategies.
Tab groups are containers for grouping and managing tabs. Properties control the appearance and behavior of a tab group. Use dot notation to refer to a particular object and property.
f = figure; tg = uitabgroup(f); tg.Position = [.1 .1 .8 .8];
TabLocation— Tab label location
Tab label location, specified as
'right'. This property specifies the location of the
tab labels with respect to the tab group.
SelectedTab— Currently selected tab
Currently selected tab, specified as a
Use this property to determine the currently selected tab within a tab group. You can also use this property to set the default selection.
The default value of the
SelectedTab property is the
first tab that you add to the tab group.
Visible— State of visibility
'on'(default) | on/off logical value
State of visibility, specified as
or as numeric or logical
false). A value of
is equivalent to
'off' is equivalent to
false. Thus, you can use the value of this property as a logical
value. The value is stored as an on/off logical value of type
'on' — Display the object.
'off' — Hide the object without deleting it. You
still can access the properties of an invisible UI component.
To make your app start faster, set the
Visible property to
'off' for all components that do not need to appear at
Changing the size of an invisible container triggers the
SizeChangedFcn callback when it becomes visible.
Visible property of a container does
not change the values of the
properties of child components. This is true even though hiding the container causes the
child components to be hidden.
ContextMenu— Context menu
GraphicsPlaceholderarray (default) |
Context menu, specified as a
ContextMenu object created using the
uicontextmenu function. Use this property to display a context menu when
you right-click on a component.
SelectionChangedFcn— Selection changed callback
''(default) | function handle | cell array | character vector
Selection changed callback, specified as one of these values:
A function handle.
A cell array in which the first element is a function handle. Subsequent elements in the cell array are the arguments to pass to the callback function.
A character vector containing a valid MATLAB expression (not recommended). MATLAB evaluates this expression in the base workspace.
This callback function executes when the user selects a different tab within the tab group.
If you set the
SelectionChangedFcn property to a
function handle (or cell array containing a function handle), MATLAB passes a
SelectionChangedData object containing event data as the
second argument to the callback function. This object contains the
properties described in the following table. You can access these properties
inside the callback function using dot notation. For example, if the second
argument in your callback is called
event.NewValue returns the currently selected
Component that executes the callback
For more information about specifying a callback property value as a function handle, cell array, or character vector, see How to Specify Callback Property Values.
Parent— Parent object
Parent object, specified as a
Tab object. Use this
property to specify the parent container when creating a tab group or to
move an existing tab group to a different parent container.
GraphicsPlaceholderarray (default) | 1-D array of component objects
TabGroup children, returned as an empty
GraphicsPlaceholder or a 1-D array of component
objects. The children of
TabGroup objects are
You cannot add or remove children using the
property. Use this property to view the list of children or to reorder the
children. The order of the children in this array reflects the order of the
tabs displayed on the screen.
To add a child to this list, set the
property of the child component to the
Objects with the
'off' are not listed in the
Type— Type of graphics object
This property is read-only.
Type of graphics object, returned as
UIContextMenuproperty is not recommended
Not recommended starting in R2020a
Starting in R2020a, using the
UIContextMenu property to assign a
context menu to a graphics object or UI component is not recommended. Use the
ContextMenu property instead. The property values are the
There are no plans to remove support for the
property at this time. However, the
UIContextMenu property no
longer appears in the list returned by calling the
get function on a
graphics object or UI component.