TabIndex 属性TabIndex property

指定单个对象在窗体的 Tab 键顺序中的位置。Specifies the position of a single object in the form's tab order.

语法Syntax

对象TabIndex[= Integer ]object.TabIndex [= Integer ]

TabIndex 属性语法包含以下部分:The TabIndex property syntax has these parts:

PartPart 说明Description
objectobject 必需。Required. 一个有效对象。A valid object.
IntegerInteger 可选。Optional. 一个介于 0 和比具有 TabIndex 属性的窗体上的控件的数目小 1 的数字之间的整数。An integer from 0 to one less than the number of controls on the form that have a TabIndex property. 分配小于 0 的 TabIndex 值会产生错误。Assigning a TabIndex value of less than 0 generates an error. 如果为 TabIndex 赋予大于最大索引数的值,系统将把它重新设置为最大许可值。If you assign a TabIndex value greater than the largest index value, the system resets the value to the maximum allowable value.

备注Remarks

Tab 键顺序中的第一个对象的索引值为 0。The index value of the first object in the tab order is zero.

另请参阅See also

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.