I would like to use modern UI controls in my WinForms project and ideally, HandyControl. Since xaml is not used in WinForms, I followed microsoft's Hosting a WPF Composite Control in Windows Forms guide without success.
MyControls WPF UserControl MyControl1.xaml
WinForms Form1_LoadCode:<UserControl x:Class="UserControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:MyControls" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"> <UserControl.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/> <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </UserControl.Resources> <Grid> </Grid> </UserControl>
All references are included and the projects compile without problems, but I cannot use any WPF or HandyControl controls. Ideally I would like to add HandyControl or WPF controls in my toolbox. Any ideas?Code:Dim host = New ElementHost() host.Dock = DockStyle.Fill Panel1.Controls.Add(host) Dim uc = New MyControls.UserControl1 uc.InitializeComponent() host.Child = uc




Reply With Quote
