Hello everybody,
I Have a piece of code for a Pocket PC that has a
disabled and hidden textbox control at startup. It is
enabled and set visible programatically. The cursor is
captured calling the focus method.
The problem is: the focus is lost almost inmediately. I
can't type in anything.
See the code below.
Any ideas?
Thank you,
Carlos Lozano
The code is like this:
SetVisible(bool toggle)
{
if (toggle)
{
bool lfocus = false;
tName.Enabled = true;
tName.Visible = true;
tName.Show(); // The control is shown at this point
lfocus = tName.Focus();
/* I found lfocus is true when debugging. Meaning
it got the focus, but seems it lost focus
inmediately.
*/
}
else
{
tName.Visible = false;
tName.Enabled = false;
tName.Hide(); // The control is hidden again
}
}