Results 1 to 2 of 2

Thread: [2008] How to open a WPF application from a Form

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2008
    Posts
    3

    [2008] How to open a WPF application from a Form

    How would I open a WPF(xaml) application from a windows form?



    I want the "Mampi paint" button to open up the wpf application I have in this project called, "UserControl1.xaml".

    How would I do that?

    Thanks

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2008] How to open a WPF application from a Form

    From your terminology it's not clear what you actually want. Are you saying that you want to click that button and start a whole separate application, or that you want to display a WPF control on your existing Windows Form?

    If it's the former then the fact that it's a WPF app is irrelevant. You call Process.Start to run any application, regardless of how it was created.

    If it's the latter then you will need to add an ElementHost control to your form from the WPF Interoperability section of the Toolbox, which you can then add WPF controls to. WPF applications have a corresponding WindowsFormsHost control that allows you to embed Windows Forms controls in a WPF Window.
    Last edited by jmcilhinney; Aug 7th, 2008 at 06:33 PM.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width