全部显示

CurrentSectionTop 属性

       

应用该属性可以确定从当前的顶边到窗体顶边的距离,以为单位。

expression.CurrentSectionTop

expression   必需。返回“Applies To”列表中的一个对象的表达式。

说明

此属性设置仅在使用Visual Basic 时使用。

用户滚动窗体时,CurrentSectionTop 属性的设置将会改变。

对于 DefaultView 属性设置为“单一窗体”的窗体,当用户将滚动条拖到窗体左上角的上方时,该属性的值将成为负数。

对于 DefaultView 属性设置为“连续窗体”的窗体,如果当前节不可见,那么 CurrentSectionTop 属性与窗体的 InsideHeight 属性值相等.

CurrentSectionTop 属性用于查找“窗体”视图连续窗体的或“数据表”视图中的主体节位置。每一个主体节都有不同的 CurrentSectionTop 属性设置,取决于该节在窗体中的位置。

示例

下面的示例显示了连续窗体上一个控件的 CurrentSectionLeftCurrentSectionTop 属性设置。当用户移到一个新记录时,当前节的属性设置将显示在窗体标题的 lblStatus 标签中。

Private Sub Form_Current()

    Dim intCurTop As Integer
    Dim intCurLeft As Integer

    intCurTop = Me.CurrentSectionTop
    intCurLeft = Me.CurrentSectionLeft
    Me!lblStatus.Caption = intCurLeft & " , " & intCurTop

End Sub