IUIAutomationTextRange::ScrollIntoView 方法 (uiautomationclient.h)

使文字控件捲動,直到檢視區中顯示文字範圍為止。

語法

HRESULT ScrollIntoView(
  [in] BOOL alignToTop
);

參數

[in] alignToTop

類型: BOOL

True 是表示 如果應該捲動文字控件,讓文字範圍與檢視區頂端排清; 如果 應該以檢視區底部排清,則為 FALSE。

傳回值

類型: HRESULT

如果此方法成功,則會傳回 S_OK。 否則,它會傳回 HRESULT 錯誤碼。

備註

方法會同時遵守隱藏和可見的文字。 如果文字範圍已隱藏,則只有在隱藏的文字在檢視區中有錨點時,文字控件才會捲動。

Microsoft 使用者介面自動化 用戶端可以呼叫 IUIAutomationTextRange::GetAttributeValue,並將 attr 參數設定為 UIA_IsHiddenAttributeId來檢查文字可見性。

規格需求

需求
最低支援的用戶端 Windows 7、Windows Vista sp2 和 Platform Update for Windows Vista、Windows XP with SP3 和 Platform Update for Windows Vista [僅限桌面應用程式]
最低支援的伺服器 Windows Server 2008 R2、Windows Server 2008 SP2 和 Platform Update for Windows Server 2008、Windows Server 2003 SP2 和 Platform Update for Windows Server 2008 [僅限桌面應用程式]
目標平台 Windows
標頭 uiautomationclient.h (包含 UIAutomation.h)

另請參閱

IUIAutomationTextRange

文字內容的 使用者介面自動化 支援