Keep focus in text boxes

  • Thread starter Thread starter Hilton
  • Start date Start date
H

Hilton

Hi,

This is a C#, CF 1.0 app for the Smartphone (e.g. Cingular Blackjack).

I have a page with some controls and some text boxes. The (non-text box)
controls should never get the focus. The focus must always remain with one
of the text boxes. Since CF 1.0 does not have TabStop, what would be the
easiest/best way of doing this?

BTW: Ilya (or other MS folks), does Label have its TabStop hard-coded to
false?

Thanks,

Hilton
 
Hi,

You can add a handler on the evt GotFocus of all your controls, then
add code to give the focus to your main textBox.
It is not very clean but I don't have a better idea.

BR


Fabien Decret
Windows Embedded Consultant


ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/
 
Fabien,

Thanks, but...

Let's you have:

TextBox1
Control
TextBox2

When the control gets the focus, does he give it to TextBox1 or TextBox2?
So that's one problem, although it is solvable. The second problem I'm
having is when I arrow down from the last text box on the screen, something
has the focus and I cannot figure out what. It just sure it really messy
and I wish MS would have included TabStop and TabIndex which are kinda core
to usability. Oh well...

Hilton


Hi,

You can add a handler on the evt GotFocus of all your controls, then
add code to give the focus to your main textBox.
It is not very clean but I don't have a better idea.

BR


Fabien Decret
Windows Embedded Consultant


ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/
 
Didn't one of the SPs for CF 1.0 add tab support (no tab index specifically,
but a tab order that matches z-order)? I think it was SP3.
 
Chris,

Tabbing works (using the CFs that I have on my Pocket PCs and Smartphone),
the real problem is that Controls that should never have the focus, get it;
i.e. the carat goes away and it ain't pretty. Sometimes the carat goes away
until you tab 12 times, then all of a sudden it reappears!

Clearly a mistake not to have TabStop and TabIndex in CF1. It is in CF2.

It is not too bad on a Pocket PC because the user can tap on the textbox,
but on the Smartphone, tabbing is the only way to navigate.

Hilton
 
Back
Top