Infragistics2.Win.v8.1
ControlElement Property
See Also  Example
Infragistics.Win Namespace > UIElement Class : ControlElement Property

Returns the top level/control element. Read-only.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property ControlElement As ControlUIElementBase
C# 
public ControlUIElementBase ControlElement {get;}

Example

This sample demonstrates BorderStyle in use with the ControlElement and IsFlatModeProperty. If the ControlElement is in flat mode, we draw a simple solid border, otherwise we draw raised.

Visual BasicCopy Code
    Imports Infragistics.Win

    Public Overrides Property BorderStyle() As UIElementBorderStyle

        Get

                    ' Returns borderstyle based on FlatMode property of the control.
            If Me.ControlElement.UltraControl.IsFlatMode Then
                Return UIElementBorderStyle.Solid
            Else
                Return UIElementBorderStyle.Raised
            End If

        End Get

        Set(ByVal Value As UIElementBorderStyle)

            MyBase.BorderStyle = Value

        End Set

    End Property
C#Copy Code
       using Infragistics.Win;

       
public override UIElementBorderStyle BorderStyle
       {

           get
           {

               
// Return borderstyle based on FlatMode property of the control.

               
if (this.ControlElement.UltraControl.IsFlatMode)
                   
return UIElementBorderStyle.Solid;
               
else
                   
return UIElementBorderStyle.Raised;

           }

       }

See Also