更改某些ActiveX和表单控件的Tab键顺序
我在我的工作表中创build了一些text-boxes
( ActiveX Controls
), checkboxes
( Form Controls
)和一个end-button
( Form Controls
),并希望在它们之间tab
。
我怎样才能做到这一点?
也许只有VBA才有可能。
提前非常感谢您的回答。
没有办法通过属性(我知道)来做到这一点,但是你总是可以使用KeyDown
事件,捕获Tab键,然后使用.Verb
将焦点设置到你想要的位置。 例如,如果您有一个checkbox,一个combobox和一个文本框:
Private Sub CheckBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) If KeyCode = 9 Then ComboBox1.Verb End If End Sub Private Sub ComboBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) If KeyCode = 9 Then TextBox1.Verb End If End Sub Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) If KeyCode = 9 Then CheckBox1.Verb End If End Sub