1
votes

I have a customized WPF button control and I want to use this control with a WinForm application. I know how to use WPF user controls with WinForm using ElementHost. But I have no idea to use any single control (not a user control) with all its members with a WinForm application. Can you suggest me a good way to achieve this

2
Stick to one platform. If your app is small (say less than 100 controls total) convert the whole thing to WPF. If it's too big or you can't decide to rewrite it (say over 1000 controls) stick WinForms until you can rewrite it. It looks downright ugly to have one fancy button slapped on a standard winform and it can bring technical complications tooSten Petrov

2 Answers

4
votes

Use ElementHost from System.Windows.Forms.Integration namespace

Here is detailed tutorial

1
votes

Can't you wrap it to a UserControl? You can still use Host.CustomizedButton.xxx to access all the properties and methods.