Set forcus for control in a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a Form.control, a textbox in a form. Initially, the control has
forcus. However, after user click this control, I need to insert something
into the textbox, which caused the losing forcus of control, and obtaining
forcus for the textbox.

Is there a property or method I can use to keep the forcus in control? I
want to catch the KeyDown or KeyPress event for this control. However it is
not stopping at the breakpoint due to losing forcus.

Any solution is highly appreciated.
 
Hello Gary,

use Focus/Select methods of your control

G> I have a Form.control, a textbox in a form. Initially, the control
G> has forcus. However, after user click this control, I need to insert
G> something into the textbox, which caused the losing forcus of
G> control, and obtaining forcus for the textbox.
G>
G> Is there a property or method I can use to keep the forcus in
G> control? I want to catch the KeyDown or KeyPress event for this
G> control. However it is not stopping at the breakpoint due to losing
G> forcus.
G>
G> Any solution is highly appreciated.
G>
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 

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

Back
Top