Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ToolBarTray Class

Layout container that handles the layout of a ToolBar.

Namespace: System.Windows.Controls
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

[ContentPropertyAttribute("ToolBars")] 
public class ToolBarTray : FrameworkElement, IAddChild
/** @attribute ContentPropertyAttribute("ToolBars") */ 
public class ToolBarTray extends FrameworkElement implements IAddChild
ContentPropertyAttribute("ToolBars") 
public class ToolBarTray extends FrameworkElement implements IAddChild
<ToolBarTray>
  ToolBars
</ToolBarTray>

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>
           <ToolBar Band="2" BandIndex="1">
                <Button><Image Source="toolbargraphics\undo.bmp" /></Button>
                <Button><Image Source="toolbargraphics\redo.bmp" /></Button>
           </ToolBar>
           <ToolBar Band="2" BandIndex="2">
                <Button><Image Source="toolbargraphics\paint.bmp" /></Button>
                <Button><Image Source="toolbargraphics\spell.bmp" /></Button>
                <Separator/>
                <Button><Image Source="toolbargraphics\save.bmp" /></Button>
                <Button><Image Source="toolbargraphics\open.bmp" /></Button>
           </ToolBar>
        </ToolBarTray>

System.Object
   System.Windows.Threading.DispatcherObject
     System.Windows.DependencyObject
       System.Windows.Media.Visual
         System.Windows.UIElement
           System.Windows.FrameworkElement
            System.Windows.Controls.ToolBarTray

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

Show:
© 2014 Microsoft