setting the focus on a control when i change of tab

  • Thread starter Thread starter wavemill
  • Start date Start date
W

wavemill

Hello!

A textbox will get focus after the form is initialized, but
when you switch from tab to tab, that won't change the focus.

I have try to add TextBox.Focus() in the TabControl_selexIndexChanged event.
but the tab keep always the focus?

Have you got anu idea?

Wavemill
 
wavemill said:
Hello!

A textbox will get focus after the form is initialized, but
when you switch from tab to tab, that won't change the focus.

I have try to add TextBox.Focus() in the TabControl_selexIndexChanged event.
but the tab keep always the focus?

Have you got anu idea?

Wavemill

Are you running Service Pack 2 of the CF? I had loads of trouble with
Focusing before I applied the Service Pack. Might just be that
 
I haven't verified this yet, but my first guess would be that the tab has not yet received focus when the selectedIndexChanged event is fired i.e.
(1) selectedIndexChanged is fired
(2) you set focus to the textbox
(3) the system sets focus to the tab page.

Try looking for a ReceivedFocus event on the tab page and do your textBox.focus() there.
 
Hello!

Thank's for your answers!

My problem is there is not tab page gotfocus event for tab page, just
for tab control!

I work with windows mobile 2003 et sp2

If you have another idea?

Best regards!

wavemill
 
Back
Top