all groups > dotnet compact framework > november 2005 >
You're in the

dotnet compact framework

group:

Textbox not receiving the focus


Textbox not receiving the focus Echo
11/29/2005 10:11:24 PM
dotnet compact framework:
Hi all. Maby someone can help me with a problem. I have a smart device
application that I have written. On one form(Form 1) is called first
and the contrucion of the form continues. Now before I show Form 1 I
call another form(Form 2) that checks that if the client needs to print
the incidents, Form 2 gets called and displayed where he/she can select
a printer. Now the problem is if the printer is selected Form 1 gets
shown and the client can start. On this form I have a
textbox(txtEmployee) that needs to get the focus on(without using the
tab order). I have been stepping through my code and I set the focus on
that textbox. But the focus doesn't go onto that textbox. I have tried
the gotFocus and noticed that the textbox doesn't receive the focus. It
goes onto Form 1. When Form 1 gts shown the focus is set by the command
txtEmployee.Focus(); line but the event gotFocus does not fire. But
when I do not call Form 2 up everything works fine and the textbox then
receive the focus.

Can anyone help me please.
Thanks in advance.
Echo
Re: Textbox not receiving the focus Arun
11/29/2005 11:04:29 PM
Try Application.DoEvents after the focus and see if it works

Cheers,
Arun.
AddThis Social Bookmark Button