Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default How can I set focus back or remained on Textbox?

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default How can I set focus back or remained on Textbox?

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" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default How can I set focus back or remained on Textbox?

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" wrote in message

...



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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA to set focus back to exel Waxaholic Excel Programming 0 January 15th 08 06:38 PM
How to tell what textbox got the focus vqthomf Excel Programming 2 November 18th 05 01:09 PM
How do I get focus back on an Excel file? Stumpiana Charts and Charting in Excel 1 November 18th 05 01:21 AM
How do I get focus back on an Excel file? Stumpiana Excel Programming 2 November 17th 05 09:19 PM
TextBox focus 4 Tim Coddington Excel Programming 6 August 4th 04 03:51 AM


All times are GMT +1. The time now is 01:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"