Textbox focus again again

G

Guest

Last week I posted this for the first time. However, I didn't get any useable
solution to my problem. I'm very keen on getting this problem solved, so
please excuse me for trying again. I'll try to be a little more precise.

I have an app running (minimized) and without showing itself on the task
bar. It puts an icon in the task pane (next to the clock), and when I click
this icon, a message handler is invoked and creates a new usercontrol on the
screen. This usercontrol contains a textbox. This textbox is the problem.
When the usercontrol appears I would like to give input to the textbox
immediately. I use the focus() method but all that happens is that I get a
text-cursor (flashing in the textbox) and it looks like its ready for input.
However, when I type on the keyboard, nothing happens. I have to click
somewhere on the usercontrol for the textbox to capture input from the
keyboard. I do not think that focus method is the key to the solution, I've
tried several combination from various methods. It looks like the fokus
medthod works on application level - or form - level, and not on Operating
system level - is that correct, any solution to my problem.

Thank you,
Regards Jesper.
 
L

Ludovic SOEUR

1) Focus method is useless when a form is shown for the first time if you
correctly entered TabIndex fields for each component. The field that will
first have focus is the one with the value '0'.

2) However, with Focus method, it would have worked. Do you have 'Enter' or
'GotFocus' that set a focus in one of the parent chain of your textbox ? If
not, how do you show your form ? How do you set the focus ? To your textbox
or to your usercontrol ? Do you have a sample of your code that you could
provide ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top