共用方式為


ComboBoxAutomationPeer.SetValue Methods

設定控制項的值。

超載清單

方法 說明
SetValue(String) Sets the value of a control, as an implementation of the IValueProvider pattern.
SetValue(DependencyProperty, Object) Sets the local value of a dependency property on a DependencyObject.

備註

ComboBoxAutomationPeer 會定義 SetValue(String) 方法,而這是實作 IRangeValueProvider 自動化模式的方法。這個方法是主要的 SetValue 方法,對於 UI 自動化案例很有用。不過,因為使用者介面自動化對等也繼承自基底類別 DependencyObject,其中有另一個完全不同用途、稱為 SetValue 的方法。這不是刻意多載基底 DependencyObject 實作之自動化對等的案例。相反地,它是巧合名稱衝突和實作詳細資料。在大部分使用者介面自動化情節中,您應該忽略 DependencyObject 版本的 SetValue,永遠使用 ComboBoxAutomationPeer 定義的 SetValue(String)

需求

最低支援的用戶端

Windows 8

最低支援的伺服器

Windows Server 2012

命名空間

Windows.UI.Xaml.Automation.Peers Windows::UI::Xaml::Automation::Peers [C++]

中繼資料

Windows.winmd

另請參閱

ComboBoxAutomationPeer