FrameworkElement.FindName(String) FrameworkElement.FindName(String) FrameworkElement.FindName(String) FrameworkElement.FindName(String) Method

定義

尋找具有所提供之識別項名稱的項目。Finds an element that has the provided identifier name.

public:
 System::Object ^ FindName(System::String ^ name);
public object FindName (string name);
member this.FindName : string -> obj
Public Function FindName (name As String) As Object

參數

name
String String String String

要求之項目的名稱。The name of the requested element.

傳回

要求的項目。The requested element. 如果找不到相符的項目,這可能會是 nullThis can be null if no matching element was found.

備註

如果項目具有子項目,這些子元素會遞迴地搜尋所有要求的具名項目。If the element has child elements, these child elements are all searched recursively for the requested named element.

FindName 可在目前的項目名稱範圍內操作。FindName operates within the current element's namescope. 如需詳細資訊,請參閱 < WPF XAML NamescopesFor details, see WPF XAML Namescopes.

適用於

另請參閱