Display System.Windows.Forms.Form as child of Wpf Window
-
Hello all, I am quite new in wpf and i am having some problem in displaying an System.Windows.forms.Form as child of my WPF main window I have a WPF application opening some system.windows.forms.form from WPF menu but the problem is i am unable to make those winforms as child of WPF Main Window because of which i cant show the winform as center parent. Can anybody help me out how to make the WPF Window parent of the windows.forms.form
abhinav
-
Hello all, I am quite new in wpf and i am having some problem in displaying an System.Windows.forms.Form as child of my WPF main window I have a WPF application opening some system.windows.forms.form from WPF menu but the problem is i am unable to make those winforms as child of WPF Main Window because of which i cant show the winform as center parent. Can anybody help me out how to make the WPF Window parent of the windows.forms.form
abhinav
You need to add the
WindowsFormsIntegration
namespace to your project. For more info, google "WPF Winforms integration". There are many good examples out there..45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001 -
You need to add the
WindowsFormsIntegration
namespace to your project. For more info, google "WPF Winforms integration". There are many good examples out there..45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001 -
thanks John for ur quick reply can you please provide me some helpful links actually i searched a lot but didnt found any apropriate solution
abhinav
Well, I don't know what you want to do (and I don't really care), so you're going to have to come up with your own google phrase. The one I provided is merely a starting point. Besides that, if you're not actually co-mingling winforms controls on a WPF form (or the other way around), there really is no magic involved that I can think of. Just create the winforms form and be done with it.
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001 -
Well, I don't know what you want to do (and I don't really care), so you're going to have to come up with your own google phrase. The one I provided is merely a starting point. Besides that, if you're not actually co-mingling winforms controls on a WPF form (or the other way around), there really is no magic involved that I can think of. Just create the winforms form and be done with it.
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001John, if you want to know just read his post. It's very simple to read and very simple to understand (or do not make this kind of answer). This is a very specific problem and google will not help. And abhinav the WindowsFormsIntegration.dll cannot help you for your problem. Just try to listen Application.Current.Activated and Deactivated event to change the TopMost value of the form. I guess it can be a good beginning...
Need help ? Ask me :)