posted on Saturday, February 18, 2006 2:31 PM by davidboschmans

Crossbow or Windows Forms and WPF Interop

Already heard of "Crossbow"? If not then you might want to check out the MSDN TV Episode on "Crossbow" - Windows Forms and Windows Presentation Foundation Interoperability.

Mike Henderlight introduces the "Crossbow" technology and describes how you can use it to build hybrid Windows Forms and Windows Presentation Foundation applications. The interop from a WPF application using Windows Forms controls is actally realized by referencing the System.Windows.Forms and WindowsFormsIntegration assemblies. Next you create a WindowsFormHost control that allows you to host a Windows Forms control as an element of a Windows Presentation Foundation page. Add a windows forms control (eg. a button)  to the hostcontrol and add the hostcontrol to the WPF window. Running this shows a simple windows forms button displayed on a WPF window. All of this can also be done through XAML.
And of course hosting Windows Forms controls from a Windows Presentation Foundation is possible too. This is realized by using the ElementHost class. This class can be used to host a Windows Presentation Foundation (formerly code-named "Avalon") element.

The latest version of the WindowsFormsIntegration.dll to use is the one of the Cider drop CTP. From Mike's post you can learn why it's important to pick the right version of the WindowsFormsIntegration.dll.

There's also an article that's worth reading on Windows Presentation Foundation Interoperability in Dr. Dobb's.

Comments

# re: Crossbow or Windows Forms and WPF Interop

Thursday, July 26, 2007 1:45 PM by Eleni
Cool...

# re: Crossbow or Windows Forms and WPF Interop

Friday, July 27, 2007 1:28 PM by Yiannis
interesting

# re: Crossbow or Windows Forms and WPF Interop

Friday, July 27, 2007 9:38 PM by Adamantios
Sorry :(

# re: Crossbow or Windows Forms and WPF Interop

Saturday, July 28, 2007 1:36 AM by Fotis
Cool.

# re: Crossbow or Windows Forms and WPF Interop

Saturday, July 28, 2007 1:50 AM by Theologos
Nice!

# re: Crossbow or Windows Forms and WPF Interop

Saturday, July 28, 2007 8:20 PM by Kimon
Nice

# re: Crossbow or Windows Forms and WPF Interop

Sunday, July 29, 2007 9:02 AM by Augustinos
Nice!

# re: Crossbow or Windows Forms and WPF Interop

Sunday, July 29, 2007 7:04 PM by Carolos
Cool.

# re: Crossbow or Windows Forms and WPF Interop

Monday, July 30, 2007 2:25 AM by Xenophon
Cool.

# re: Crossbow or Windows Forms and WPF Interop

Monday, July 30, 2007 4:37 AM by Ilias
Sorry :(

# re: Crossbow or Windows Forms and WPF Interop

Monday, July 30, 2007 7:08 PM by Miltos
Nice...

# re: Crossbow or Windows Forms and WPF Interop

Tuesday, July 31, 2007 12:30 AM by Nico
Sorry :(

# re: Crossbow or Windows Forms and WPF Interop

Wednesday, August 01, 2007 8:11 PM by Manolis
Cool.

# re: Crossbow or Windows Forms and WPF Interop

Wednesday, August 01, 2007 8:51 PM by Savvas
Nice!

# re: Crossbow or Windows Forms and WPF Interop

Thursday, August 02, 2007 12:55 PM by Augustinos
Interesting...

# re: Crossbow or Windows Forms and WPF Interop

Thursday, August 02, 2007 3:59 PM by Metrophanes
Cool!

# re: Crossbow or Windows Forms and WPF Interop

Thursday, August 02, 2007 11:25 PM by Herakles
Cool!

# re: Crossbow or Windows Forms and WPF Interop

Saturday, August 04, 2007 4:31 AM by Nathanael
Nice...

# re: Crossbow or Windows Forms and WPF Interop

Sunday, August 05, 2007 3:49 AM by Zacharias
Sorry :(

# re: Crossbow or Windows Forms and WPF Interop

Sunday, August 05, 2007 9:27 AM by Kyriacos
Cool...

# re: Crossbow or Windows Forms and WPF Interop

Sunday, August 05, 2007 10:25 PM by Othon
Nice

# re: Crossbow or Windows Forms and WPF Interop

Monday, August 06, 2007 2:02 AM by Panos
Cool!

# re: Crossbow or Windows Forms and WPF Interop

Monday, August 06, 2007 8:36 AM by Myron
Cool...

# re: Crossbow or Windows Forms and WPF Interop

Monday, August 06, 2007 3:16 PM by Nikodemos
Nice

# re: Crossbow or Windows Forms and WPF Interop

Monday, August 06, 2007 9:50 PM by Tassos
Cool.

# re: Crossbow or Windows Forms and WPF Interop

Tuesday, August 07, 2007 3:13 AM by Alekos
Interesting...

# re: Crossbow or Windows Forms and WPF Interop

Tuesday, August 07, 2007 9:57 AM by Alekos
Cool.

# re: Crossbow or Windows Forms and WPF Interop

Tuesday, August 07, 2007 6:09 PM by Titos
Cool!

# re: Crossbow or Windows Forms and WPF Interop

Tuesday, August 07, 2007 10:09 PM by Sotirios
Nice

# re: Crossbow or Windows Forms and WPF Interop

Wednesday, August 08, 2007 1:04 AM by Andreas
Nice

# re: Crossbow or Windows Forms and WPF Interop

Wednesday, August 08, 2007 9:26 PM by Antonios
Nice!

# re: Crossbow or Windows Forms and WPF Interop

Thursday, August 09, 2007 9:04 AM by Maximos
Nice

# re: Crossbow or Windows Forms and WPF Interop

Friday, August 10, 2007 8:48 AM by Aiolos
Nice

# re: Crossbow or Windows Forms and WPF Interop

Friday, August 10, 2007 3:38 PM by Samaras
Sorry :(

# re: Crossbow or Windows Forms and WPF Interop

Saturday, August 11, 2007 12:34 AM by Matthaios
interesting

# re: Crossbow or Windows Forms and WPF Interop

Saturday, August 11, 2007 5:54 AM by Ari
Cool.

# re: Crossbow or Windows Forms and WPF Interop

Saturday, August 11, 2007 12:22 PM by Bikos
Cool.

# re: Crossbow or Windows Forms and WPF Interop

Saturday, August 11, 2007 4:47 PM by Stefanos
Cool.

# re: Crossbow or Windows Forms and WPF Interop

Saturday, August 11, 2007 5:12 PM by Vassilis
interesting

# re: Crossbow or Windows Forms and WPF Interop

Saturday, August 11, 2007 10:43 PM by Sotiris
Interesting...

# re: Crossbow or Windows Forms and WPF Interop

Sunday, August 12, 2007 9:49 AM by Themestoclis
Cool...

# re: Crossbow or Windows Forms and WPF Interop

Sunday, August 12, 2007 10:44 AM by Dimitrios
Nice!

# re: Crossbow or Windows Forms and WPF Interop

Sunday, August 12, 2007 10:36 PM by Evis
Sorry :(

# re: Crossbow or Windows Forms and WPF Interop

Sunday, August 12, 2007 11:11 PM by Xenophon
Interesting...

# re: Crossbow or Windows Forms and WPF Interop

Sunday, August 12, 2007 11:13 PM by Efthimios
Nice

# re: Crossbow or Windows Forms and WPF Interop

Tuesday, August 14, 2007 12:23 PM by Milos
interesting

# re: Crossbow or Windows Forms and WPF Interop

Tuesday, August 14, 2007 7:46 PM by Drymiotes
Cool.

# re: Crossbow or Windows Forms and WPF Interop

Wednesday, August 15, 2007 12:58 AM by Gregorios
Interesting...

# re: Crossbow or Windows Forms and WPF Interop

Wednesday, August 15, 2007 6:45 PM by Efstratios
Cool.

# re: Crossbow or Windows Forms and WPF Interop

Thursday, August 16, 2007 3:19 AM by Hippocrates
Cool...

# re: Crossbow or Windows Forms and WPF Interop

Thursday, August 16, 2007 8:55 AM by Valerios
interesting

# re: Crossbow or Windows Forms and WPF Interop

Thursday, August 16, 2007 9:09 AM by Argyros
Cool!

# re: Crossbow or Windows Forms and WPF Interop

Thursday, August 16, 2007 11:09 AM by Orestis
Cool!

# re: Crossbow or Windows Forms and WPF Interop

Friday, August 17, 2007 3:15 AM by Spyros
Sorry :(

# re: Crossbow or Windows Forms and WPF Interop

Friday, August 17, 2007 3:22 AM by Periklis
Cool...

# re: Crossbow or Windows Forms and WPF Interop

Friday, August 17, 2007 1:11 PM by Argyros
Nice...

# re: Crossbow or Windows Forms and WPF Interop

Friday, August 17, 2007 7:29 PM by Kyriakos
interesting

# re: Crossbow or Windows Forms and WPF Interop

Saturday, August 18, 2007 3:11 AM by Aleksiu
Sorry :(

# re: Crossbow or Windows Forms and WPF Interop

Saturday, August 18, 2007 7:29 AM by Stathis
Nice

# re: Crossbow or Windows Forms and WPF Interop

Saturday, August 18, 2007 2:21 PM by Angelo
Nice!

# re: Crossbow or Windows Forms and WPF Interop

Saturday, August 18, 2007 8:41 PM by Angelos
interesting

# re: Crossbow or Windows Forms and WPF Interop

Saturday, August 18, 2007 11:37 PM by Stefanos
Cool.

# re: Crossbow or Windows Forms and WPF Interop

Sunday, August 19, 2007 3:18 AM by Lefteris
Cool...

# re: Crossbow or Windows Forms and WPF Interop

Sunday, August 19, 2007 4:00 AM by Alekos
Nice

# re: Crossbow or Windows Forms and WPF Interop

Sunday, August 19, 2007 9:23 AM by Zaharias
Cool!

# re: Crossbow or Windows Forms and WPF Interop

Sunday, August 19, 2007 12:06 PM by Athones
Cool!

# re: Crossbow or Windows Forms and WPF Interop

Sunday, August 19, 2007 3:03 PM by Paulos
Cool!

# re: Crossbow or Windows Forms and WPF Interop

Sunday, August 19, 2007 7:37 PM by Andreas
Cool...

# re: Crossbow or Windows Forms and WPF Interop

Sunday, August 19, 2007 9:26 PM by Sergios
interesting

# re: Crossbow or Windows Forms and WPF Interop

Monday, August 20, 2007 5:49 AM by Leo
Interesting...

# re: Crossbow or Windows Forms and WPF Interop

Monday, August 20, 2007 5:52 AM by Aleda
Nice...

# re: Crossbow or Windows Forms and WPF Interop

Monday, August 20, 2007 8:16 AM by Nicolas
interesting

# re: Crossbow or Windows Forms and WPF Interop

Monday, August 20, 2007 11:44 AM by Nicolaon
Sorry :(

# re: Crossbow or Windows Forms and WPF Interop

Monday, August 20, 2007 7:50 PM by Emmanuil
Sorry :(

# re: Crossbow or Windows Forms and WPF Interop

Tuesday, August 21, 2007 3:31 AM by Angelos
Nice!

# re: Crossbow or Windows Forms and WPF Interop

Tuesday, August 21, 2007 6:39 AM by Dimitris
interesting

# re: Crossbow or Windows Forms and WPF Interop

Tuesday, August 21, 2007 12:03 PM by Dimitrios
Interesting...

# re: Crossbow or Windows Forms and WPF Interop

Tuesday, August 21, 2007 3:01 PM by Dionyssios
Cool...

# re: Crossbow or Windows Forms and WPF Interop

Tuesday, August 21, 2007 8:10 PM by Apostolos
interesting

# re: Crossbow or Windows Forms and WPF Interop

Wednesday, August 22, 2007 6:12 AM by Cletus
Cool.

# re: Crossbow or Windows Forms and WPF Interop

Wednesday, August 22, 2007 6:30 AM by Glafkos
Cool...

# re: Crossbow or Windows Forms and WPF Interop

Wednesday, August 22, 2007 6:41 AM by Titos
Sorry :(

# re: Crossbow or Windows Forms and WPF Interop

Wednesday, August 22, 2007 1:39 PM by Spyros
Interesting...

# re: Crossbow or Windows Forms and WPF Interop

Wednesday, August 22, 2007 5:38 PM by Othon
Cool...

# re: Crossbow or Windows Forms and WPF Interop

Thursday, August 23, 2007 6:20 AM by Photios
Interesting...

# re: Crossbow or Windows Forms and WPF Interop

Thursday, August 23, 2007 7:05 AM by Loukas
Nice...

# re: Crossbow or Windows Forms and WPF Interop

Thursday, August 23, 2007 12:41 PM by Valerios
Cool...

# re: Crossbow or Windows Forms and WPF Interop

Thursday, August 23, 2007 5:33 PM by Rhigas
Interesting...

# re: Crossbow or Windows Forms and WPF Interop

Thursday, August 23, 2007 6:43 PM by Evis
Cool.

# re: Crossbow or Windows Forms and WPF Interop

Thursday, August 23, 2007 7:35 PM by Sterghios
Nice

# re: Crossbow or Windows Forms and WPF Interop

Thursday, August 23, 2007 9:06 PM by Vangelis
Sorry :(

# re: Crossbow or Windows Forms and WPF Interop

Friday, August 24, 2007 4:43 AM by Tasos
Nice

# re: Crossbow or Windows Forms and WPF Interop

Friday, August 24, 2007 7:48 AM by Ambrosios
Nice!

# re: Crossbow or Windows Forms and WPF Interop

Friday, August 24, 2007 2:20 PM by Iannis
Nice...

# re: Crossbow or Windows Forms and WPF Interop

Saturday, August 25, 2007 4:30 AM by Nathanael
Nice!

# re: Crossbow or Windows Forms and WPF Interop

Saturday, August 25, 2007 6:53 AM by Demetrios
interesting

# re: Crossbow or Windows Forms and WPF Interop

Saturday, August 25, 2007 12:01 PM by Pantelis
Nice

# re: Crossbow or Windows Forms and WPF Interop

Saturday, August 25, 2007 9:11 PM by Alexander
Sorry :(

# re: Crossbow or Windows Forms and WPF Interop

Saturday, August 25, 2007 11:44 PM by Cosmo
Nice

# re: Crossbow or Windows Forms and WPF Interop

Sunday, August 26, 2007 5:16 AM by Hippocrates
Interesting...

# re: Crossbow or Windows Forms and WPF Interop

Sunday, August 26, 2007 7:28 AM by Savas
Sorry :(

# re: Crossbow or Windows Forms and WPF Interop

Sunday, August 26, 2007 8:28 AM by Herakles
Nice

# re: Crossbow or Windows Forms and WPF Interop

Sunday, August 26, 2007 9:55 AM by Timotheos
Nice...