Table of contents

Label.TopMargin 属性 (访问)Label.TopMargin Property (Access)

office 365 dev account|上次更新日期: 2018/3/13
2 参与人员

LeftMarginRightMargin,和文本底边距属性,指定一个标签控件中显示的信息的位置。读取/写入的整数Along with the LeftMargin, RightMargin, and BottomMargin properties, specifies the location of information displayed within a label control. Read/write Integer.


表达式TopMarginexpression. TopMargin

表达式_一个表示Label对象的变量。_expression A variable that represents a Label object.


控件中的显示信息位置指从控件的左、 上、 右或下边框,到左、 上、 右或底部边缘所显示的信息。LeftMarginTopMargin属性设置为 0 会显示的信息的边缘放到的最左方或控件的顶部。若要使用在 Windows 区域设置中设置不同的度量单位,请自行指定单位 (例如,厘米或英寸)。A control's displayed information location is measured from the control's left, top, right, or bottom border to the left, top, right, or bottom edge of the displayed information. Setting the LeftMargin or TopMargin property to 0 places the displayed information's edge at the very left or top of the control. To use a unit of measurement different from the setting in the regional settings of Windows, specify the unit (for example, cm or in).

在 Visual Basic 中,使用数值表达式设置此属性的值,值以缇为单位表示。In Visual Basic, use a numeric expression to set the value of this property. Values are expressed in twips.


下面的示例从“Purchase Orders”窗体的“EmployeeID_Label”标签的边框顶部,将其中的标题偏移 100 缇。The following example offsets the caption in the label "EmployeeID_Label" in the "Purchase Orders" form by 100 twips from the top of the label's border.

With Forms.Item("Purchase Orders").Controls.Item("EmployeeID_Label") 
 .TopMargin = 100 
End With

另请参阅See also


标签对象Label Object

© 2018 Microsoft