I am trying to add a .net user control to a stackpanel in a winfx
windows application. Whenever I try to add the <WindowsFormsHost> tag to the
xaml I get an error like below. The error below was generated from a simple
winfx app as shown in the msdn link
(http://windowssdk.msdn.microsoft.com...sFormsHost.asp)
I have set my references to both C:\Program Files\Microsoft Visual
Studio 8\Common7\IDE\Cider\WindowsFormsIntegration.dll and C:\Program
Files\Reference Assemblies\Microsoft\WPF\v3.0\WindowsFormsIntegration.dll.
Neither seem to work. My namespace is
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
I have visual studio 2005 pro and february ctp release. I installed them
in the order listed.
Not sure what else to do? Any help is greatly appreciated.
Thanks,
Jeff
Error Message:
Warning 1 The element 'Grid' in namespace
'http://schemas.microsoft.com/winfx/2006/xaml/presentation' has invalid
child element 'WindowsFormsHost' in namespace
'http://schemas.microsoft.com/winfx/2006/xaml/presentation'. List of
possible elements expected: 'Grid.ShowGridLines, Grid.ColumnDefinitions,
Grid.RowDefinitions, Grid.Background, Grid.IsItemsHost, Grid.Style,
Grid.OverridesDefaultStyle, Grid.Triggers, Grid.Resources, Grid.DataContext,
Grid.Language, Grid.Tag, Grid.InputScope, Grid.LayoutTransform, Grid.Width,
Grid.MinWidth, Grid.MaxWidth, Grid.Height, Grid.MinHeight, Grid.MaxHeight,
Grid.Margin, Grid.FocusVisualStyle, Grid.Cursor, Grid.ForceCursor,
Grid.Focusable, Grid.ToolTip, Grid.ContextMenu, Grid.InputBindings,
Grid.CommandBindings, Grid.AllowDrop, Grid.RenderSize, Grid.RenderTransform,
Grid.RenderTransformOrigin, Grid.Opacity, Grid.OpacityMask,
Grid.BitmapEffect, Grid.BitmapEffectInput, Grid.ClipToBounds, Grid.Clip,
Grid.SnapsToDevicePixels, Grid.IsEnabled, Grid.I****TestVisible,
sgUIElement, sgFrameworkElement, sgShape, Ellipse, Line, Path, Polygon,
Polyline, Rectangle, sgPanel, Canvas, DockPanel, Grid, TabPanel,
ToolBarOverflowPanel, sgStackPanel, ToolBarPanel, UniformGrid,
sgVirtualizingPanel, VirtualizingStackPanel, WrapPanel, sgControl, sgC....
C:\WindowsApplication1\WindowsApplication1\Window1.xaml 9 6
WindowsApplication1
Sample XAML:
<Window x:Class="WindowsApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
Title="WindowsApplication1" Height="300" Width="300"
>
<Grid>
<WindowsFormsHost>
<wf:MaskedTextBox x:Name="mtbDate" Mask="00/00/0000"/>
</WindowsFormsHost>
</Grid>
</Window>



