Results 1 to 4 of 4

Thread: [RESOLVED] Run winform inside WPF window.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2013
    Posts
    66

    Resolved [RESOLVED] Run winform inside WPF window.

    Very new to xaml. Is it possible to place a window form inside a WPF window. I realize that winform controls can be used , but I'm talking about the whole form being placed in the WPF window. Thank you.

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

    Re: Run winform inside WPF window.

    It seems an odd thing to do but a form is a control too so you can use it like any other control. You'd have to add it to the container at run time and you should set its TopLevel property to False.

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,274

    Re: Run winform inside WPF window.

    That said, WPF is not Modern/Metro. You can publish XAML apps to the Store but they are not WPF. If this is genuinely a WPF app then this is the wrong forum for this thread and if it is a Store app then it's not WPF and you won't be able to load a Windows Form.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jan 2013
    Posts
    66

    Re: Run winform inside WPF window.

    Thank you for the timely response. It is a WTP.
    So this is the code for a textbox.

    <WindowsFormsHost Margin="0,23,0.4,-23.2">
    <wf:TextBox x:Name="textbox1" Text="Hello World"/>
    </WindowsFormsHost>


    What would you use for a whole form?

Tags for this Thread

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