Text Box Focus

  • Thread starter Thread starter Tim Coddington
  • Start date Start date
T

Tim Coddington

I have a bunch of option buttons and one text box on a form.
I want only the text box to have focus, so each time a user
clicks on an option button, the button is selected and focus
returns to TextBox1. I could go like ...

Private Sub OptionButton{1 of 20 numbers}_Click()
TextBox1.SetFocus
End Sub

But is there a way to make TextBox1 take focus automatically
so there is not so much repetition of 'TextBox1.SetFocus' in
my code? Perhaps there is a way to disable each option button
from ever getting focus when clicked (and still allow it to be
selected)?
 
Tim,

One thing you could consider is set the focus to the TextBox in
the MouseMove event for the frame or the form.

Regards,
Jim Cone
San Francisco, CA
 

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

Back
Top