none
Hosting a WPF user control in VB6 applications

    Question

  • Has anybody ever wanted to host a WPF user control in a VB 6 application? If so how can this be done. I have seen how this can be done from a Win32 C++ application.
    Tuesday, November 14, 2006 8:11 PM

Answers

  • So, the answer is yes and it turns out that it's not all that difficult, although there are some caveots

    Here's the details:

    1) For this to work, you need to install and use the interop forms toolkit 2.0 which will be released later this month.   You can check this link/forum for further details.

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=604443&SiteID=1

    2) This toolkit has a new feature that allows you to easily create an activex usercontrol built in .net that you can then add to your VB6 applications and use.

    3) Using this combined with the elementhost control which allows you to host WPF controls in Winforms then gives you the ability to host WPF controls in VB6 apps.

    I've done this a fair bit and generally, it works pretty well.   There are some caveots though:

    a) This (hosting WPF controls in a elementhost control and placing this on a VB6 host) isn't a supported scenario, so you may run into some limitations and/or you'll have to work around issues on your own

    b) From my usage, there are some (mostly minor) UI painting issues as well as tabbing problems that you may run into tabbing from WPF controls to VB6 hosts.   Otherwise, most "standard" functionality seems to work fine.

    However, when we release this toolkit, try it out and see if it works for you.   It's pretty exciting to see what you can do here...

    Toddap

     

     

     

     

    Monday, January 15, 2007 6:39 PM
    Moderator

All replies

  • So, the answer is yes and it turns out that it's not all that difficult, although there are some caveots

    Here's the details:

    1) For this to work, you need to install and use the interop forms toolkit 2.0 which will be released later this month.   You can check this link/forum for further details.

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=604443&SiteID=1

    2) This toolkit has a new feature that allows you to easily create an activex usercontrol built in .net that you can then add to your VB6 applications and use.

    3) Using this combined with the elementhost control which allows you to host WPF controls in Winforms then gives you the ability to host WPF controls in VB6 apps.

    I've done this a fair bit and generally, it works pretty well.   There are some caveots though:

    a) This (hosting WPF controls in a elementhost control and placing this on a VB6 host) isn't a supported scenario, so you may run into some limitations and/or you'll have to work around issues on your own

    b) From my usage, there are some (mostly minor) UI painting issues as well as tabbing problems that you may run into tabbing from WPF controls to VB6 hosts.   Otherwise, most "standard" functionality seems to work fine.

    However, when we release this toolkit, try it out and see if it works for you.   It's pretty exciting to see what you can do here...

    Toddap

     

     

     

     

    Monday, January 15, 2007 6:39 PM
    Moderator
  • Hi,

    are there any news about interop forms toolkit 2.0?

    Thanks
    Alex

    Tuesday, February 06, 2007 10:56 PM
  • Hi Matty,

     

    You mention:

     

    I have seen how this can be done from a Win32 C++ application.

     

    I want to do this, host a WPF form inside of a MFC C++ app.  Can you point me in the right direction?

     

    Thanks!

    E

    Tuesday, December 18, 2007 9:58 PM