Thread: focus
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Earl Kiosterud[_3_] Earl Kiosterud[_3_] is offline
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