Gishu
Gishu

Reputation: 136613

Does WPF have equivalent controls for all Winforms controls?

Just found this out the hard way. I wanted to pop up a FontDialog to allow the user to choose a font.. one of those familiar dialogs..

Upvotes: 5

Views: 1531

Answers (5)

user21243
user21243

Reputation: 53

Embedding Windows forms using the WindowsFormsHost can cause a lot of problems - especially when dealing rendering\ visibility etc..

Some controls are already implemented by others and could be found over the WEB such as:

NumericUpDown DateTimePicker SplitButton

and of course the new WPFDataGrid

Upvotes: 1

Gishu
Gishu

Reputation: 136613

Not all of them have equivalents.
The FontDialog for instance doesnt.. (grumble grumble). This page has the complete lowdown.. posting since it may be useful just as a mental note. http://msdn.microsoft.com/en-us/library/ms750559.aspx

Update: The Programming WPF book had this covered. Apparently some of the dialogs didn't make the RTM bus. The FontDialog that will included into the next update is available here.. as is the ColorPicker dialog. Also you shuoldn't blindly use Win32 dialogs, because the corresponding types in WPF (e.g. Font and Color are "bigger and better" now.)

http://blogs.msdn.com/wpfsdk/archive/2006/10/26/Uncommon-Dialogs--Font-Chooser-and-Color-Picker-Dialogs.aspx

Upvotes: 7

Tamas Czinege
Tamas Czinege

Reputation: 121294

Unfortunately, it does not. However, you can "borrow" some of Windows Forms dialogs by using the Microsoft.Win32 namespace, or you can integrate Windows Forms controls by using the System.Windows.Forms.WindowsFormHost WPF element. Also, you can display Windows Forms dialogs directly by calling the constructor and then invoking the ShowDialog() method on them.

Upvotes: 0

Michael Pliskin
Michael Pliskin

Reputation: 2352

I know a team working on a WPF application for a couple of years by now, and their feedback is that WPF is still a no match to WinForms when it comes to complicated controls (advanced data grids, tree views and the like). Basic controls are ok though.

Upvotes: 0

rudigrobler
rudigrobler

Reputation: 17133

VistaBridge samples have wrappers for some of the vista dialog boxes!

Also check out the wrappers provided by System.Win32 Microsoft.Win32

[UPDATE] `Microsoft.Win32.FileDialog

Upvotes: 1

Related Questions