Click to See Complete Forum and Search --> : focus() not working in new thread


dreyln
March 25th, 2003, 09:46 PM
I have a Form with a bunch of stuff on it, including a Button that the user can push to do a bunch of things in another thread. In the Button's click function, I set the Button's enabled property to false and then spawn off a thread to do some stuff.
The function that gets passed to the thread is called start and the button is called stepBtn. Inside the function that gets passed to the thread to execute I have the following:
<code>
private void start()
{
//bunch of stuff is done
stepBtn.Enabled = true;
stepBtn.Focus(); //this returns false
}
</code>

The button gets enabled but Focus() returns false. I can't get this to work.
Could this be a threading issue? Any ideas?

pareshgh
March 27th, 2003, 01:46 PM
try

BringToFront()
Select()
Show()
and
Focus()

Paresh