AutomationPeer.GetAutomationControlTypeCore 方法

定義

當 Microsoft 使用者介面自動化 用戶端呼叫 GetAutomationControlType 或對等的 Microsoft 使用者介面自動化 用戶端 API 時,提供對等的行為。

protected:
 virtual AutomationControlType GetAutomationControlTypeCore() = GetAutomationControlTypeCore;
AutomationControlType GetAutomationControlTypeCore();
protected virtual AutomationControlType GetAutomationControlTypeCore();
function getAutomationControlTypeCore()
Protected Overridable Function GetAutomationControlTypeCore () As AutomationControlType

傳回

控制項類型。

備註

AutomationPeerFrameworkElementAutomationPeer 的基底實作會傳回 Custom。 如果您保留此行為,則必須覆寫 GetLocalizedControlTypeCore

定義自動化對等的較常見案例是覆寫其中一個與您要覆寫之控件類別配對的現有對等類別。 在此情況下,每個對等類別都會報告 AutomationControlType 的實際價值,對等實作對等的原始擁有者控件而言很合理。 通常您可以單獨保留此行為。 通常不是衍生自控件特定的對等,而是使用其行為,而是變更 AutomationControlType,這可能是對等報告的最基本資訊。 檢查您要覆寫之對等類別的現有行為,並確認您報告正確的控件類型。 此外,請仔細檢查是否有更特定的對等類別可供報告正確的控件類型,並提供更適合您對等的其他行為。 如需詳細資訊,請參閱自訂自動化對等

適用於

另請參閱