Home All Groups Group Topic Archive Search About

Using WPF with a "normal" windows app

Author
28 Jun 2009 12:06 AM
Lloyd Sheen
I was wondering if there is any way to incorporate a WPF form within an
existing windows app.

Have googled but this is the type of question that is hard to phrase to get
results.

Alternative if it won't work is to create a form with a browser control and
generate HTML but that is not the route I want to go since it will not be
very easy to maintain.

Thanks
LS

Author
28 Jun 2009 12:15 AM
Jeff Richards
You can do it by hosting a WPF control in a Form.

See, for instance:
http://msdn.microsoft.com/en-us/library/ms742215.aspx
Walkthrough: Hosting a Windows Presentation Foundation Control in Windows
Forms

That site has references to other examples
--
Jeff Richards
MS MVP (Windows - Shell/User)
Show quoteHide quote
"Lloyd Sheen" <a@b.c> wrote in message
news:%23XrQSR49JHA.1340@TK2MSFTNGP05.phx.gbl...
>I was wondering if there is any way to incorporate a WPF form within an
>existing windows app.
>
> Have googled but this is the type of question that is hard to phrase to
> get results.
>
> Alternative if it won't work is to create a form with a browser control
> and generate HTML but that is not the route I want to go since it will not
> be very easy to maintain.
>
> Thanks
> LS
Are all your drivers up to date? click for free checkup

Author
28 Jun 2009 12:46 PM
Lloyd Sheen
Show quote Hide quote
"Jeff Richards" <JRicha***@msn.com.au> wrote in message
news:eOfAbW49JHA.4204@TK2MSFTNGP04.phx.gbl...
> You can do it by hosting a WPF control in a Form.
>
> See, for instance:
> http://msdn.microsoft.com/en-us/library/ms742215.aspx
> Walkthrough: Hosting a Windows Presentation Foundation Control in Windows
> Forms
>
> That site has references to other examples
> --
> Jeff Richards
> MS MVP (Windows - Shell/User)
> "Lloyd Sheen" <a@b.c> wrote in message
> news:%23XrQSR49JHA.1340@TK2MSFTNGP05.phx.gbl...
>>I was wondering if there is any way to incorporate a WPF form within an
>>existing windows app.
>>
>> Have googled but this is the type of question that is hard to phrase to
>> get results.
>>
>> Alternative if it won't work is to create a form with a browser control
>> and generate HTML but that is not the route I want to go since it will
>> not be very easy to maintain.
>>
>> Thanks
>> LS
>
>

Thanks will try that,

LS
Author
30 Jun 2009 2:05 PM
Lloyd Sheen
Show quote Hide quote
"Lloyd Sheen" <a@b.c> wrote in message
news:Ox3BF6%239JHA.5040@TK2MSFTNGP04.phx.gbl...
>
> "Jeff Richards" <JRicha***@msn.com.au> wrote in message
> news:eOfAbW49JHA.4204@TK2MSFTNGP04.phx.gbl...
>> You can do it by hosting a WPF control in a Form.
>>
>> See, for instance:
>> http://msdn.microsoft.com/en-us/library/ms742215.aspx
>> Walkthrough: Hosting a Windows Presentation Foundation Control in Windows
>> Forms
>>
>> That site has references to other examples
>> --
>> Jeff Richards
>> MS MVP (Windows - Shell/User)
>> "Lloyd Sheen" <a@b.c> wrote in message
>> news:%23XrQSR49JHA.1340@TK2MSFTNGP05.phx.gbl...
>>>I was wondering if there is any way to incorporate a WPF form within an
>>>existing windows app.
>>>
>>> Have googled but this is the type of question that is hard to phrase to
>>> get results.
>>>
>>> Alternative if it won't work is to create a form with a browser control
>>> and generate HTML but that is not the route I want to go since it will
>>> not be very easy to maintain.
>>>
>>> Thanks
>>> LS
>>
>>
>
> Thanks will try that,
>
> LS

Well this did not go well.  I get to step 5 in the instructions before it
falls apart.  I can create the WPF Browser Application but cannot change the
Output Type.  This is so MS typical.

I guess it cannot be done.  Oh well maybe in VS 2050.

LS
Author
30 Jun 2009 3:23 PM
Lloyd Sheen
Show quote Hide quote
"Lloyd Sheen" <a@b.c> wrote in message
news:e194PvY%23JHA.1336@TK2MSFTNGP05.phx.gbl...
>
> "Lloyd Sheen" <a@b.c> wrote in message
> news:Ox3BF6%239JHA.5040@TK2MSFTNGP04.phx.gbl...
>>
>> "Jeff Richards" <JRicha***@msn.com.au> wrote in message
>> news:eOfAbW49JHA.4204@TK2MSFTNGP04.phx.gbl...
>>> You can do it by hosting a WPF control in a Form.
>>>
>>> See, for instance:
>>> http://msdn.microsoft.com/en-us/library/ms742215.aspx
>>> Walkthrough: Hosting a Windows Presentation Foundation Control in
>>> Windows Forms
>>>
>>> That site has references to other examples
>>> --
>>> Jeff Richards
>>> MS MVP (Windows - Shell/User)
>>> "Lloyd Sheen" <a@b.c> wrote in message
>>> news:%23XrQSR49JHA.1340@TK2MSFTNGP05.phx.gbl...
>>>>I was wondering if there is any way to incorporate a WPF form within an
>>>>existing windows app.
>>>>
>>>> Have googled but this is the type of question that is hard to phrase to
>>>> get results.
>>>>
>>>> Alternative if it won't work is to create a form with a browser control
>>>> and generate HTML but that is not the route I want to go since it will
>>>> not be very easy to maintain.
>>>>
>>>> Thanks
>>>> LS
>>>
>>>
>>
>> Thanks will try that,
>>
>> LS
>
> Well this did not go well.  I get to step 5 in the instructions before it
> falls apart.  I can create the WPF Browser Application but cannot change
> the Output Type.  This is so MS typical.
>
> I guess it cannot be done.  Oh well maybe in VS 2050.
>
> LS

I did find this link if anyone is interested.  It describes (correctly) how
to do this.

http://www.a2zdotnet.com/View.aspx?id=78

LS
Author
1 Jul 2009 4:13 AM
Jeff Richards
Show quote Hide quote
"Lloyd Sheen" <a@b.c> wrote in message
news:uDcYJbZ%23JHA.3320@TK2MSFTNGP04.phx.gbl...
>
> snip <
>>
>> Well this did not go well.  I get to step 5 in the instructions before it
>> falls apart.  I can create the WPF Browser Application but cannot change
>> the Output Type.  This is so MS typical.
>>
>> I guess it cannot be done.  Oh well maybe in VS 2050.
>>
>> LS
>
> I did find this link if anyone is interested.  It describes (correctly)
> how to do this.
>
> http://www.a2zdotnet.com/View.aspx?id=78
>
> LS
I guess I should have made the point that the MS documentation is patchy,
and you needed to follow on through the references from that page, and to
whatever else the keywords there might lead you to. It's possible that the
samples and description aren't a lot worse than other parts of MSDN, but I
noticed a steeper than usual learning curve, if only because almost
everything is in C# rather than VB. This applies to other sources, not just
MS. Needing to get to grips with XAML didn't help.
--
Jeff Richards
MS MVP (Windows - Shell/User)
Author
1 Jul 2009 8:56 AM
Olaf Rabbachin
Hi Lloyd,

Lloyd Sheen wrote:

> I did find this link if anyone is interested.  It describes (correctly) how
> to do this.
>
> http://www.a2zdotnet.com/View.aspx?id=78

FWIW - here's another link from the MSDN. I didn't really follow up to it,
just ran it once:

"Walkthrough: Hosting a Windows Presentation Foundation Control in Windows
Forms" -> http://msdn.microsoft.com/en-us/library/ms742215.aspx

Cheers,
Olaf
Author
30 Jun 2009 10:51 PM
James Hahn
It can definately be done, but it's certainly not simple. For instance, I
have a Windows Forms app that uses WPF to display a panning tilting rotating
blinking textured 3D view of my data and it's very effective.

Note however, that a lot of the documentation is out of date due to the
significant changes that have occurred over its life, and you need to
consider which version any example was used with.  I also find it very
annoying that so few examples use VB - you will need to have a C# to VB
converter available if you want to use the example code, and you need to
allow for any differences in IDE setup.

And the documenation for XAML is lousy.

Show quoteHide quote
"Lloyd Sheen" <a@b.c> wrote in message
news:e194PvY%23JHA.1336@TK2MSFTNGP05.phx.gbl...
>
> "Lloyd Sheen" <a@b.c> wrote in message
> news:Ox3BF6%239JHA.5040@TK2MSFTNGP04.phx.gbl...
>>
>> "Jeff Richards" <JRicha***@msn.com.au> wrote in message
>> news:eOfAbW49JHA.4204@TK2MSFTNGP04.phx.gbl...
>>> You can do it by hosting a WPF control in a Form.
>>>
>>> See, for instance:
>>> http://msdn.microsoft.com/en-us/library/ms742215.aspx
>>> Walkthrough: Hosting a Windows Presentation Foundation Control in
>>> Windows Forms
>>>
>>> That site has references to other examples
>>> --
>>> Jeff Richards
>>> MS MVP (Windows - Shell/User)
>>> "Lloyd Sheen" <a@b.c> wrote in message
>>> news:%23XrQSR49JHA.1340@TK2MSFTNGP05.phx.gbl...
>>>>I was wondering if there is any way to incorporate a WPF form within an
>>>>existing windows app.
>>>>
>>>> Have googled but this is the type of question that is hard to phrase to
>>>> get results.
>>>>
>>>> Alternative if it won't work is to create a form with a browser control
>>>> and generate HTML but that is not the route I want to go since it will
>>>> not be very easy to maintain.
>>>>
>>>> Thanks
>>>> LS
>>>
>>>
>>
>> Thanks will try that,
>>
>> LS
>
> Well this did not go well.  I get to step 5 in the instructions before it
> falls apart.  I can create the WPF Browser Application but cannot change
> the Output Type.  This is so MS typical.
>
> I guess it cannot be done.  Oh well maybe in VS 2050.
>
> LS
Author
30 Jun 2009 11:10 PM
gillardg
here is a sample that i uploaded today
http://www.vbfrance.com/codes/EDITEUR-TEXTE-WINFORM-AVEC-CORRECTEUR-ORTHOGRAPHIQUE-WPF_50248.aspx

"James Hahn" <jh***@yahoo.com> a écrit dans le message de groupe de
discussion : eLOveVd#JHA.1***@TK2MSFTNGP02.phx.gbl...
Show quoteHide quote
> It can definately be done, but it's certainly not simple. For instance, I
> have a Windows Forms app that uses WPF to display a panning tilting
> rotating blinking textured 3D view of my data and it's very effective.
>
> Note however, that a lot of the documentation is out of date due to the
> significant changes that have occurred over its life, and you need to
> consider which version any example was used with.  I also find it very
> annoying that so few examples use VB - you will need to have a C# to VB
> converter available if you want to use the example code, and you need to
> allow for any differences in IDE setup.
>
> And the documenation for XAML is lousy.
>
> "Lloyd Sheen" <a@b.c> wrote in message
> news:e194PvY%23JHA.1336@TK2MSFTNGP05.phx.gbl...
>>
>> "Lloyd Sheen" <a@b.c> wrote in message
>> news:Ox3BF6%239JHA.5040@TK2MSFTNGP04.phx.gbl...
>>>
>>> "Jeff Richards" <JRicha***@msn.com.au> wrote in message
>>> news:eOfAbW49JHA.4204@TK2MSFTNGP04.phx.gbl...
>>>> You can do it by hosting a WPF control in a Form.
>>>>
>>>> See, for instance:
>>>> http://msdn.microsoft.com/en-us/library/ms742215.aspx
>>>> Walkthrough: Hosting a Windows Presentation Foundation Control in
>>>> Windows Forms
>>>>
>>>> That site has references to other examples
>>>> --
>>>> Jeff Richards
>>>> MS MVP (Windows - Shell/User)
>>>> "Lloyd Sheen" <a@b.c> wrote in message
>>>> news:%23XrQSR49JHA.1340@TK2MSFTNGP05.phx.gbl...
>>>>>I was wondering if there is any way to incorporate a WPF form within an
>>>>>existing windows app.
>>>>>
>>>>> Have googled but this is the type of question that is hard to phrase
>>>>> to get results.
>>>>>
>>>>> Alternative if it won't work is to create a form with a browser
>>>>> control and generate HTML but that is not the route I want to go since
>>>>> it will not be very easy to maintain.
>>>>>
>>>>> Thanks
>>>>> LS
>>>>
>>>>
>>>
>>> Thanks will try that,
>>>
>>> LS
>>
>> Well this did not go well.  I get to step 5 in the instructions before it
>> falls apart.  I can create the WPF Browser Application but cannot change
>> the Output Type.  This is so MS typical.
>>
>> I guess it cannot be done.  Oh well maybe in VS 2050.
>>
>> LS
>

Bookmark and Share