IUIAutomationExpandCollapsePattern::Expand 方法 (uiautomationclient.h)

顯示專案的所有子節點、控件或內容。

Syntax

HRESULT Expand();

傳回值

類型: HRESULT

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

備註

這是在專案展開之後傳回的封鎖方法。

在某些情況下,標示為分葉節點的專案可能不知道它是否具有子系,直到 呼叫 IUIAutomationExpandCollapsePattern::Collapse呼叫 IUIAutomationExpandCollapsePattern::Expand 方法為止。 這種行為可以透過樹視圖控件來延遲載入其子專案。 例如,Microsoft Windows 檔案總管可能會顯示節點的展開圖示,即使目前沒有子專案也一樣;按兩下圖示時,控件會輪詢子項目、尋找無專案,並移除展開圖示。 在這些情況下,客戶端應該接聽 IUIAutomationExpandCollapsePattern::CurrentExpandCollapseState 屬性上的屬性變更事件。

規格需求

需求
最低支援的用戶端 Windows 7、Windows Vista SP2 和 Platform Update for Windows Vista、Windows XP 含 SP3 和適用於 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)

另請參閱

IUIAutomationExpandCollapsePattern