#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default focus

Hi

I've got a form from which my users will select files. If they double click a text box, the open file dialog will appear and they can choose their file. The problem is that after they select their file they need to click out of the text box before any other control will respond. For example, there's a button that basically says "okay get the file". If I select a file, and then hit the button -- I have to hit the button twice. OR if I select a file, go to another text box to get a different type of file, I have to click that other text box before it will hear the double click

Any suggestions

Art
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default focus

Art,

You can give the "Okay, get the file" button the focus with the SetFocus
method:

Private Sub TextBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
TextBox1.Value = Application.GetOpenFilename
OkayGetTheFileButton.SetFocus

Now the text box no longer has focus, so any button can be clicked, and the
Enter key can also be used for button OkayGetTheFileButton, since it has
focus.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Art" wrote in message
...
Hi,

I've got a form from which my users will select files. If they double

click a text box, the open file dialog will appear and they can choose their
file. The problem is that after they select their file they need to click
out of the text box before any other control will respond. For example,
there's a button that basically says "okay get the file". If I select a
file, and then hit the button -- I have to hit the button twice. OR if I
select a file, go to another text box to get a different type of file, I
have to click that other text box before it will hear the double click.

Any suggestions?

Art



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
focus Capp Excel Discussion (Misc queries) 2 November 18th 05 07:25 PM
set focus tkaplan Excel Discussion (Misc queries) 3 September 27th 05 07:41 PM
Set Focus gregork Excel Programming 2 March 7th 04 05:29 AM
How do I set focus Newbie Excel Programming 2 February 11th 04 07:03 PM
set focus RickK Excel Programming 1 October 10th 03 12:27 PM


All times are GMT +1. The time now is 06:41 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"