Hi,
Sorry. Unfortunately, I am not able to reproduce this issue.
I drag a button and a textbox on the wpf UserControl:
namespace WpfControlLibrary1
{
/// <summary>
/// Interaction logic for UserControl1.xaml
/// </summary>
public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
textBox1.Text += "1";
textBox1.Focus();
}
}
}
In the winform application.
private void Form1_Load(object sender, EventArgs e)
{
ElementHost host = new ElementHost();
host.Dock = DockStyle.Fill;
WpfControlLibrary1.UserControl1 uc = new WpfControlLibrary1.UserControl1();
host.Child = uc;
this.Controls.Add(host);
}
When I click the button, the textbox show ��and get focus.
I think I must miss something. Could you please provide more details or make a demo project for us to test? Please upload your demo project to some server and offer us the URL. Skydrive (http://skydrive.live.com/ ) may be a good option. You can sign up 25GB free space only with your Windows Live Passport.
More information:
Walkthrough: Hosting a Windows Presentation Foundation Composite Control in Windows Forms
http://msdn.microsoft.com/en-us/library/ms745781.aspx
Best regards,
Ling Wang
Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.