Create toggle button component
creates toggle button within
a button group and returns the tb
= uitogglebuttonToggleButton
object.
MATLAB® calls the uifigure
function to create the parent figure of
the button group.
specifies tb
= uitogglebutton(___,Name,Value
)ToggleButton
properties using one or more
Name,Value
pair arguments. Use this option with any of the input argument
combinations in the previous syntaxes.
Button groups can contain any UI component type, but can only manage the selection of radio buttons and toggle buttons.
To make your program respond when the app user selects a radio button or toggle button
that is inside a button group. define a SelectionChangedFcn
callback
function for the ButtonGroup
object. You cannot define
callbacks for the individual buttons.
To determine which radio button or toggle button is selected, query the
SelectedObject
property of the ButtonGroup
object. You can execute this query anywhere in your code.
If you set the Visible
property of a ButtonGroup
object to 'off'
, then any child objects it contains
become invisible along with the parent ButtonGroup
. However,
the Visible
property value of each child object remains unaffected.