PC Review


Reply
Thread Tools Rate Thread

How can I set focus back or remained on Textbox?

 
 
Tetsuya Oguma
Guest
Posts: n/a
 
      5th Mar 2008
Hi all,

I use the following Events associated with Textbox
1. BeforeDropOrPaste (for OLE drag and drop)
2. Keydown (for capturing key stroke)

by Taborder, the next control that gets focused is Commandbutton.

Simply put, I want focus to remain in the Textbox control when user presses
Enter key.

At the moment, I can clear the entry in the Textbox but no matter how I code
it focus shifts to the Commandbutton...

Thanks in advance.
Tetsuya Oguma
 
Reply With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      5th Mar 2008
Hi Tetsuya,

Change these Textbox properties

EnterKeyBehavior True
MultiLine True

Now hitting Enter will create a new line, not sure if that's what you want.

Regards,
Peter T

"Tetsuya Oguma" <(E-Mail Removed)> wrote in message
news:F7A9381D-74D3-41DE-9EB7-(E-Mail Removed)...
> Hi all,
>
> I use the following Events associated with Textbox
> 1. BeforeDropOrPaste (for OLE drag and drop)
> 2. Keydown (for capturing key stroke)
>
> by Taborder, the next control that gets focused is Commandbutton.
>
> Simply put, I want focus to remain in the Textbox control when user

presses
> Enter key.
>
> At the moment, I can clear the entry in the Textbox but no matter how I

code
> it focus shifts to the Commandbutton...
>
> Thanks in advance.
> Tetsuya Oguma



 
Reply With Quote
 
Susan
Guest
Posts: n/a
 
      5th Mar 2008
maybe as part of your coding simply add in

textbox1.set focus

so even if the focus wanders to the command button, it's instantly
redirected back to the textbox.
just an idea.

susan



> "Tetsuya Oguma" <TetsuyaOg...@discussions.microsoft.com> wrote in message
>
> news:F7A9381D-74D3-41DE-9EB7-(E-Mail Removed)...
>
>
>
> > Hi all,

>
> > I use the following Events associated with Textbox
> > 1. BeforeDropOrPaste (for OLE drag and drop)
> > 2. Keydown (for capturing key stroke)

>
> > by Taborder, the next control that gets focused is Commandbutton.

>
> > Simply put, I want focus to remain in the Textbox control when user

> presses
> > Enter key.

>
> > At the moment, I can clear the entry in the Textbox but no matter how I

> code
> > it focus shifts to the Commandbutton...

>
> > Thanks in advance.
> > Tetsuya Oguma- Hide quoted text -

>
> - Show quoted text -


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
focus back to slide / TextBox Control? Geoff Cox Microsoft Powerpoint 4 22nd Dec 2006 08:08 PM
Cant set focus back to textbox on exit =?Utf-8?B?ZmFiZXJr?= Microsoft Access Form Coding 3 12th Jun 2006 04:59 PM
TextBox focus 4 Tim Coddington Microsoft Excel Programming 6 4th Aug 2004 03:51 AM
TextBox.Focus() doesn't focus kwarnke Microsoft Dot NET Framework Forms 3 19th May 2004 10:50 PM
THIS HAS REMAINED UNUNSWERED........please help e.t. Windows XP Messenger 3 5th Sep 2003 01:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:59 AM.