Documentation Center

  • Trial Software
  • Product Updates


Create toolbar on figure


ht = uitoolbar('PropertyName1',value1,'PropertyName2',value2,...)
ht = uitoolbar(h,...)


ht = uitoolbar('PropertyName1',value1,'PropertyName2',value2,...) creates an empty toolbar at the top of the current figure window, and returns a handle to it. uitoolbar assigns the specified property values, and assigns default values to the remaining properties. You can change the property values at a later time using the set function.

Type get(ht) to see a list of uitoolbar object properties and their current values. Type set(ht) to see a list of uitoolbar object properties that you can set and legal property values. See the Uitoolbar Properties reference page for more information.

ht = uitoolbar(h,...) creates a toolbar with h as a parent. h must be a figure handle.


This example creates a figure with no toolbar, then adds a toolbar to it.

h = figure('ToolBar','none')
ht = uitoolbar(h)

More About

expand all


uitoolbar accepts property name/property value pairs, as well as structures and cell arrays of properties as input arguments.

Uitoolbars appear in figures whose Window Style is normal or docked. They do not appear in figures whose WindowStyle is modal. If the WindowStyle property of a figure containing a uitoolbar is changed to modal, the uitoolbar still exists and is contained in the Children list of the figure, but is not displayed until the WindowStyle is changed to normal or docked.

See Also

| | | |

Was this topic helpful?