Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

place net 2.0 control on xaml form

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 02-15-2007   #1 (permalink)
Dirk Reske
Guest


 

place net 2.0 control on xaml form

Hello,

is it possible to place an "old" .Net 2.0 custom control on a wpf form?
How? They do not appear in the VS toolbox...

thanks!
Dirk



My System SpecsSystem Spec
Old 02-15-2007   #2 (permalink)
RobinS
Guest


 

Re: place net 2.0 control on xaml form

I don't think so. They are completely different types of controls.

Robin S.
-------------------
"Dirk Reske" <_Dirk.Reske@gmx.net> wrote in message
news:eHMG8UUUHHA.1200@TK2MSFTNGP04.phx.gbl...
> Hello,
>
> is it possible to place an "old" .Net 2.0 custom control on a wpf form?
> How? They do not appear in the VS toolbox...
>
> thanks!
> Dirk
>



My System SpecsSystem Spec
Old 02-16-2007   #3 (permalink)
Horst Klein
Guest


 

Re: place net 2.0 control on xaml form

Hi Dirk

Yes you can!
See the SDK Samples.
C:\Programme\Microsoft
SDKs\Windows\v6.0\Samples\WPFSamples\MigrationInterop\WpfHostingWindowsFormsControl


To design Windows use MS Expression Blend:
http://www.microsoft.com/products/ex...blend/try.mspx

"WPF and Windows Forms are 2 very different technologies although there is
some interoperability available through WindowsFormsHost. Cider will not be
supporting IComponent, only the Windows Forms designer will support that."

Thats the reason, why Blend don't show Controls inside the WindowsFormsHost
and why the designer in VS2005 is not realy handy.

Best regards
Horst





My System SpecsSystem Spec
Old 02-16-2007   #4 (permalink)
Dirk Reske
Guest


 

Re: place net 2.0 control on xaml form

Hello,

when I add

?<?Mapping XmlNamespace="wfi"
ClrNamespace="System.Windows.Forms.Integration"
Assembly="WindowsFormsIntegration"?>
<UserControl x:Class="VMessAX.MainForm"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wfi="wfi"
xmlns:dh="dh" Height="273" Width="158">
<Grid>
<wfi:WindowsFormsHost>
</wfi:WindowsFormsHost>
</Grid>
</UserControl>

I get the messages that the tag WindowsFormsHost is not existing in
namespace wfi....

"Horst Klein" <horst.klein@vitodata.ch> schrieb im Newsbeitrag
news:%23Fn24pbUHHA.1364@TK2MSFTNGP06.phx.gbl...
> Hi Dirk
>
> Yes you can!
> See the SDK Samples.
> C:\Programme\Microsoft
> SDKs\Windows\v6.0\Samples\WPFSamples\MigrationInterop\WpfHostingWindowsFormsControl
>
>
> To design Windows use MS Expression Blend:
> http://www.microsoft.com/products/ex...blend/try.mspx
>
> "WPF and Windows Forms are 2 very different technologies although there is
> some interoperability available through WindowsFormsHost. Cider will not
> be
> supporting IComponent, only the Windows Forms designer will support that."
>
> Thats the reason, why Blend don't show Controls inside the
> WindowsFormsHost
> and why the designer in VS2005 is not realy handy.
>
> Best regards
> Horst
>
>
>
>
>



My System SpecsSystem Spec
Old 02-16-2007   #5 (permalink)
Horst Klein
Guest


 

Re: place net 2.0 control on xaml form

Hi Dirk

Try this:
<Window x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:WinForms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
Title="MyWindowsFormHostSample" Height="300" Width="300">
<Grid>
<Button Name="Button1" Height="50" Margin="0,0,0,20" Content="WPF
Button"/>
<wfi:WindowsFormsHost Name="WinFormsHost" Height="50" Margin="0,100,0,0"
Background="Yellow">
<WinForms:Button Name="MyWinFormButton" Text="Forms Button"
Height="50"/>
</wfi:WindowsFormsHost>
</Grid>
</Window>

Best regards
Horst


My System SpecsSystem Spec
Old 02-17-2007   #6 (permalink)
Laurent Bugnion [MVP]
Guest


 

Re: place net 2.0 control on xaml form

Hi,

RobinS wrote:
> I don't think so. They are completely different types of controls.


Only as different as, for example, an ActiveX control is from an HTML
placeholder :-) Integration is the key, and WindowsFormsHost is the
answer...

>
> Robin S.
> -------------------
> "Dirk Reske" <_Dirk.Reske@gmx.net> wrote in message
> news:eHMG8UUUHHA.1200@TK2MSFTNGP04.phx.gbl...
>> Hello,
>>
>> is it possible to place an "old" .Net 2.0 custom control on a wpf form?
>> How? They do not appear in the VS toolbox...
>>
>> thanks!
>> Dirk


Greetings,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Putting a certificate in the proper place after accidentally puttingit in the wrong place Morris Cox Vista security 5 09-04-2007 12:46 PM
How do I create for example a dockpanel in xaml and add elements form the code-behind? HokutoNoKen Avalon 3 05-04-2006 04:21 AM
Video Panel control XAML description for Viewing Webcam in WPF sashah Avalon 3 03-31-2006 03:06 PM
Reference a xaml window from a WinFX Custom Control Library ? Peter Fitzgibbons Avalon 3 02-24-2006 04:11 PM
Expose parameters for my user control in top level XAML Layout ? Griff Avalon 3 01-10-2006 03:53 PM


Update your Vista Drivers Update Your Vista Drivers Now!!

Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008