See Also

UIElement Class  | UIElement Members

Language

Visual Basic

C#

Show All

See Also Languages Infragistics2.Win.v7.2

Parent Property

Infragistics.Win Namespace > UIElement Class : Parent Property (UIElement)

The parent/containing element (will be null for a top level/control element).

[Visual Basic]
Public ReadOnly Property Parent As UIElement
[C#]
public UIElement Parent {get;}

Example

This code prints the UIElement heirarchy from the passed in point. Exemplifies use of the Parent property, and the method ElementFromPoint. (note: ultraProgressBar1 should be replaced by the variable representing the control you are hit testing on.)

[Visual Basic] 

        Imports Infragistics.Win
        Imports System.Diagnostics

        Private Sub PrintElementsFromPoint(ByVal p As Point)

        Dim element As UIElement = Me.ultraProgressBar1.UIElement.ElementFromPoint(p)

        While (Not element Is Nothing)
            Debug.WriteLine(element.GetType().ToString())
            Debug.Indent()
            element = element.Parent
        End While

        Debug.IndentLevel = 0

        End Sub

[C#] 

        using Infragistics.Win; 
        using System.Diagnostics; 
 
        private void PrintElementsFromPoint(Point p) 
        { 
 
            UIElement element = this.ultraProgressBar1.UIElement.ElementFromPoint(p); 
 
            while(null != element) 
            { 
                Debug.WriteLine(element.GetType().ToString()); 
                Debug.Indent(); 
                element = element.Parent; 
            } 
 
            Debug.IndentLevel = 0; 
 
        }

See Also

UIElement Class  | UIElement Members

E-mail your feedback on this topic.

Opinion about our help? Take our survey.

Copyright © 1996-2007 Infragistics, Inc. All rights reserved.

Build Version: 7.2.20072.1063