How to make a button focus in a thread in C# -
I need to create a button focus at the end of a thread I button. Focus () method does not seem to work. For Exmaple
:
Button 1 tag (object sender, EventArgs e) {thread myThread = new thread (theThread); MyThread.Start (); } TheThread () {... Button2.Focus (); // does not seem to focus on the button} However, if I click the button2 in Button1_Click Focus () will be the focus, but I can not do this for my project.
For a general solution to these issues, take a look at the class. However, for Windows Forms, you can use the method and in WPF, you can use it:
// WinForms: invoke (delegate {Button2.Focus ();} );
Comments
Post a Comment