HELP : regarding Textbox Enter and Focus Question many TIA

G

Guest

Hi ,
I did ask before but got no replies.

I have a series of textboxes, In Enter event I need to set the focus to a different textbox
I am having problems when I set focus within the Textbox Enter event.
It is looping thru the events.

Does anyone know how I can set focus to another object when the Textbox has
received focus either by keyboard or mouse event.

THANK YOU.
 
R

Rachel Suddeth

Maybe you can tell us more (or more specifically) what you need to
accomplish?
Are you trying to prevent certain textboxes from getting the focus?
 
N

Nicholas Paldino [.NET/C# MVP]

I would just hook into the key up event. It will be the last event that
is fired when a key si pressed in the textbox. When you find out that it is
the enter key, you just have to call the GetNextControl method on the
current control to find the next control in the tab order. Then call the
Focus method on that control to set the focus.

Hope this helps.
 
G

Guest

Setting the focus to another control in the Enter-event disables the first
control of getting the focus.

Maybe you should give us some extra information on what you want to do?
 

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