8

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.

GrandMasterFlush
  • 6,269
  • 19
  • 81
  • 104

1 Answers1

14

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>
Ray
  • 45,695
  • 27
  • 126
  • 169
  • Cheers Ray, I suspected that, I just wanted to make sure I hadn't missed something obvious. Winforms to WPF is quite a paradigm shift after all these years! – GrandMasterFlush Feb 03 '12 at 11:50
  • @GrandMasterFlush yeah it's quite a learning curve. I definitely like it though. – Ray Feb 03 '12 at 11:50
  • The more I use it the more it makes sense, I just wish I could visually design the dialogs as quickly as I could in Winforms. – GrandMasterFlush Feb 03 '12 at 12:08