Is it possible to combine both win forms and wpf window from single application. [Resolved]

Posted by Joewilliam under WPF on 6/17/2011 | Points: 10 | Views : 4373 | Status : [Member] | Replies : 13
Is it possible to combine both win forms and wpf window from single application.
If i use it any future issues? once i have changed into exe file.
Because i dont find any MDI window in WPF so i am planing to combine with win forms MDI.

William Mary


Responses

Posted by: Reena_jainy2k1 on: 6/17/2011 [Member] Starter | Points: 50

Up
0
Down

Resolved
hi,

Yes you can, both Windows Forms within a WPF application, and WPF controls within Windows Forms. for MDI concept check this link

http://www.blog-dotnet.com/category/C.aspx

hope this will help you

Reena Jain
Project Manager

Joewilliam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Robin_ahuja2008 on: 6/17/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,
Please check the link
http://www.codeproject.com/KB/WPF/winforms2wpf.aspx

Regards,
Robin Ahuja

Joewilliam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Joewilliam on: 6/17/2011 [Member] Starter | Points: 25

Up
0
Down
Thank you.

William Mary

Joewilliam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Joewilliam on: 6/17/2011 [Member] Starter | Points: 25

Up
0
Down
Thank you

William Mary

Joewilliam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Joewilliam on: 6/17/2011 [Member] Starter | Points: 25

Up
0
Down
Where can i write this code:

using System.Windows.Interop;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using System.Windows;

class MDIHelper {

[DllImport("user32.dll", EntryPoint = "SetParent")]
static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);

public void MakeMDI(Form MDIParentForm, Window childWindow)
{
IntPtr childHwnd = new WindowInteropHelper(childWindow).Handle;
IntPtr parentHwnd = MDIParentForm.Handle;

SetParent( childHwnd, parentHwnd );
}
}

William Mary

Joewilliam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lakn2 on: 6/17/2011 [Member] Starter | Points: 25

Up
0
Down
try this

http://stackoverflow.com/questions/3870498/is-it-absolutely-safe-to-display-a-wpf-window-from-a-winforms-form

Thanks&Regards
LakshmiNarayana Nalluri.

Joewilliam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Joewilliam on: 6/17/2011 [Member] Starter | Points: 25

Up
0
Down
Thank u i got answer.

William Mary

Joewilliam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Joewilliam on: 6/17/2011 [Member] Starter | Points: 25

Up
0
Down
Ur post is simply super.

William Mary

Joewilliam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Reena_jainy2k1 on: 6/17/2011 [Member] Starter | Points: 25

Up
0
Down
hi,

you can create a separate class with the name of MDIHelper and put the code there

Hope this will help you

Reena Jain
Project Manager

Joewilliam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Joewilliam on: 6/17/2011 [Member] Starter | Points: 25

Up
0
Down
Yes i did as you said. i got it. Thank you.

William Mary

Joewilliam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Joewilliam on: 6/17/2011 [Member] Starter | Points: 25

Up
0
Down
Any possible to create dockable window in that MDI window

William Mary

Joewilliam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Reena_jainy2k1 on: 6/18/2011 [Member] Starter | Points: 25

Up
0
Down
hi,

you can use wpf form for dockable window, you can not create this in windows form.

Hope this will help you

Reena Jain
Project Manager

Joewilliam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Joewilliam on: 6/20/2011 [Member] Starter | Points: 25

Up
0
Down
How can i create dockable window for windows application

William Mary

Joewilliam, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response