Is there a WPF equivalent for ToolStripButton?

GrandMasterFlush picture GrandMasterFlush · Feb 3, 2012 · Viewed 9.9k times · Source

I'm learning WPF and have been trying to create a toolstrip. Is there a direct equivalent of the WinForms ToolStripButton or is the correct way of use just to add a normal button and format it?

I've found that Microsoft have a page that lists WinForm controls and their WPF equivalents here but that doesn't mention the toolstripbutton.

Answer

Ray picture Ray · Feb 3, 2012

You can just put buttons inside a ToolBar and it will change the style of the buttons to make them look like a toolbar.

<ToolBar>
    <Button>Save</Button>
    <Button>Open</Button>
</ToolBar>

Looks like this:

enter image description here

If you want images in the buttons, you have to do the normal thing of modifying the content of the button.

<Button>
    <Image Source="..." />
</Button>