ToolBarTray Class

Layout container that handles the layout of a ToolBar.

Namespace: System.Windows.Controls
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:

<ContentPropertyAttribute("ToolBars")> _
Public Class ToolBarTray
	Inherits FrameworkElement
	Implements IAddChild
Dim instance As ToolBarTray

/** @attribute ContentPropertyAttribute("ToolBars") */ 
public class ToolBarTray extends FrameworkElement implements IAddChild
public class ToolBarTray extends FrameworkElement implements IAddChild

A ToolBarTray is responsible for handling placement, sizing, drag-and-drop operations, and rearranging of ToolBar controls. ToolBarTray controls are also responsible for managing the rows (or "bands") in which ToolBar controls appear. A ToolBarTray may be horizontal or vertical and, like a Menu, is often docked at the top of an application window.

The following example shows how to create a ToolBar inside a ToolBarTray. The example uses the BandIndex property to place tool bars inside tool bar trays.

<ToolBarTray Background="White">
            <ToolBar Band="1" BandIndex="1">
                <Button><Image Source="toolbargraphics\cut.bmp" /></Button>
                <Button><Image Source="toolbargraphics\copy.bmp" /></Button>
                <Button><Image Source="toolbargraphics\paste.bmp" /></Button>
           <ToolBar Band="2" BandIndex="1">
                <Button><Image Source="toolbargraphics\undo.bmp" /></Button>
                <Button><Image Source="toolbargraphics\redo.bmp" /></Button>
           <ToolBar Band="2" BandIndex="2">
                <Button><Image Source="toolbargraphics\paint.bmp" /></Button>
                <Button><Image Source="toolbargraphics\spell.bmp" /></Button>
                <Button><Image Source="toolbargraphics\save.bmp" /></Button>
                <Button><Image Source="toolbargraphics\open.bmp" /></Button>


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions