Version

DisplayStyle Property (UltraDateTimeEditor)

Gets/sets the display style used by the control.
Syntax
'Declaration
 
Public Property DisplayStyle As Infragistics.Win.EmbeddableElementDisplayStyle
public Infragistics.Win.EmbeddableElementDisplayStyle DisplayStyle {get; set;}
Remarks

The UltraDateTimeEditor control can visually emulate the display styles seen in Office2000, OfficeXP, or Office2003 by setting the DisplayStyle property appropriately, regardless of the operating system on which the control is running.

Note: When the control's DisplayStyle property is set to anything other than Standard, the BorderStyle property is not applicable.

Example
This example uses the DisplayStyle property to set the control's visual look and feel based on the operating system.

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinEditors

    Private Enum OS
        WindowsXP
        Windows2000
        Windows9X
    End Enum

    Private Sub SetupDisplayStyle()

        If GetOS() = OS.WindowsXP Then
            '   If the client machine is running WindowsXP, set the DisplayStyle property to OfficeXP
            Me.UltraTextEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.OfficeXP
            Me.UltraComboEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.OfficeXP
            Me.UltraFontNameEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.OfficeXP
            Me.UltraDateTimeEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.OfficeXP
            Me.UltraNumericEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.OfficeXP
            Me.UltraCurrencyEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.OfficeXP
        ElseIf GetOS() = OS.Windows2000 Then
            '   If the client machine is running Windows2000, set the DisplayStyle property to Office2000
            Me.UltraTextEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2000
            Me.UltraComboEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2000
            Me.UltraFontNameEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2000
            Me.UltraDateTimeEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2000
            Me.UltraNumericEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2000
            Me.UltraCurrencyEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2000
        Else
            '   If the client machine is running neither, set the DisplayStyle property to Standard
            Me.UltraTextEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Standard
            Me.UltraComboEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Standard
            Me.UltraFontNameEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Standard
            Me.UltraDateTimeEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Standard
            Me.UltraNumericEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Standard
            Me.UltraCurrencyEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Standard

            '   Set the BorderStyle property to Inset
            Me.UltraTextEditor1.BorderStyle = Infragistics.Win.UIElementBorderStyle.Inset
            Me.UltraComboEditor1.BorderStyle = Infragistics.Win.UIElementBorderStyle.Inset
            Me.UltraFontNameEditor1.BorderStyle = Infragistics.Win.UIElementBorderStyle.Inset
            Me.UltraDateTimeEditor1.BorderStyle = Infragistics.Win.UIElementBorderStyle.Inset
            Me.UltraNumericEditor1.BorderStyle = Infragistics.Win.UIElementBorderStyle.Inset
            Me.UltraCurrencyEditor1.BorderStyle = Infragistics.Win.UIElementBorderStyle.Inset
        End If

    End Sub

    '   Returns the operating system running on the client machine
    Private Function GetOS() As OS

        Dim opSys As OperatingSystem = System.Environment.OSVersion

        If opSys.Platform = PlatformID.Win32NT Then
            If opSys.Version.Major > 5 Or (opSys.Version.Major = 5 And opSys.Version.Minor >= 1) Then
                Return OS.WindowsXP
            Else
                Return OS.Windows2000
            End If
        End If

        Return OS.Windows9X

    End Function
using System.Diagnostics;
using Infragistics.Win;
using Infragistics.Win.UltraWinEditors;

   private enum OS
	{
        WindowsXP,
        Windows2000,
        Windows9X,
    }

   private void SetupDisplayStyle()
	{
        if ( GetOS() == OS.WindowsXP )
		{
			//   If the client machine is running WindowsXP, set the DisplayStyle property to OfficeXP
			this.ultraTextEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.OfficeXP;
			this.ultraComboEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.OfficeXP;
			this.ultraFontNameEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.OfficeXP;
			this.ultraDateTimeEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.OfficeXP;
			this.ultraNumericEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.OfficeXP;
			this.ultraCurrencyEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.OfficeXP;
		}
		else 
		if ( GetOS() == OS.Windows2000 )
		{
            //   If the client machine is running Windows2000, set the DisplayStyle property to Office2000
            this.ultraTextEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2000;
            this.ultraComboEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2000;
            this.ultraFontNameEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2000;
            this.ultraDateTimeEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2000;
            this.ultraNumericEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2000;
            this.ultraCurrencyEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2000;
		}
        else
		{
            //   If the client machine is running neither, set the DisplayStyle property to Standard
            this.ultraTextEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Standard;
            this.ultraComboEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Standard;
            this.ultraFontNameEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Standard;
            this.ultraDateTimeEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Standard;
            this.ultraNumericEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Standard;
            this.ultraCurrencyEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Standard;

            //   Set the BorderStyle property to Inset
            this.ultraTextEditor1.BorderStyle = Infragistics.Win.UIElementBorderStyle.Inset;
            this.ultraComboEditor1.BorderStyle = Infragistics.Win.UIElementBorderStyle.Inset;
            this.ultraFontNameEditor1.BorderStyle = Infragistics.Win.UIElementBorderStyle.Inset;
            this.ultraDateTimeEditor1.BorderStyle = Infragistics.Win.UIElementBorderStyle.Inset;
            this.ultraNumericEditor1.BorderStyle = Infragistics.Win.UIElementBorderStyle.Inset;
            this.ultraCurrencyEditor1.BorderStyle = Infragistics.Win.UIElementBorderStyle.Inset;
		}
	}

   //   Returns the operating system running on the client machine
   private OS GetOS()
	{
        OperatingSystem opSys = System.Environment.OSVersion;

        if ( opSys.Platform == PlatformID.Win32NT )
		{
            if ( opSys.Version.Major > 5 || (opSys.Version.Major == 5 && opSys.Version.Minor >= 1) )
                return OS.WindowsXP;
            else
                return OS.Windows2000;
		}

        return OS.Windows9X;

	}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also