ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disable Focus on Command Buttons (https://www.excelbanter.com/excel-programming/374435-disable-focus-command-buttons.html)

John Michl

Disable Focus on Command Buttons
 
I have a simple form with two command buttons. The user votes for one
of two options by clicking the appropriate button. Currently, when the
form opens it appears that the first button has focus. I don't want
either button to have focus to avoid "leading" the user to one button
over the other.

How can I disable focus on the form?

Thanks.

- John


Jim Cone

Disable Focus on Command Buttons
 
John,
Add a Frame to the form and make it first in the tab order.
Do not place the buttons on it, but place it between the
two buttons and set its height (or width) to ~1.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"John Michl"
wrote in message
I have a simple form with two command buttons. The user votes for one
of two options by clicking the appropriate button. Currently, when the
form opens it appears that the first button has focus. I don't want
either button to have focus to avoid "leading" the user to one button
over the other.
How can I disable focus on the form?
Thanks.
- John


Halim

Disable Focus on Command Buttons
 
Hi John,

Set the commandbutton with Tabstop = false
like :

Private Sub UserForm_Initialize()
CommandButton1.TabStop = False
End Sub


--

Regards,

Halim


"John Michl" wrote:

I have a simple form with two command buttons. The user votes for one
of two options by clicking the appropriate button. Currently, when the
form opens it appears that the first button has focus. I don't want
either button to have focus to avoid "leading" the user to one button
over the other.

How can I disable focus on the form?

Thanks.

- John



John Michl

Disable Focus on Command Buttons
 
Jim - Thanks for the advice. Worked like a charm.

www.johnmichl.com


Jim Cone wrote:
John,
Add a Frame to the form and make it first in the tab order.
Do not place the buttons on it, but place it between the
two buttons and set its height (or width) to ~1.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"John Michl"
wrote in message
I have a simple form with two command buttons. The user votes for one
of two options by clicking the appropriate button. Currently, when the
form opens it appears that the first button has focus. I don't want
either button to have focus to avoid "leading" the user to one button
over the other.
How can I disable focus on the form?
Thanks.
- John




All times are GMT +1. The time now is 03:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com