Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a WPF equivalent for ToolStripButton?

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.

like image 276
GrandMasterFlush Avatar asked Feb 03 '12 11:02

GrandMasterFlush


1 Answers

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>
like image 98
Ray Avatar answered Nov 08 '22 04:11

Ray