Version

ViewStyle Property (UltraCalendarLook)

Gets/sets the view style for the UltraCalendarLook component. Determines how controls that are attached to this instance of the component will appear.
Syntax
'Declaration
 
Public Property ViewStyle As ViewStyle
public ViewStyle ViewStyle {get; set;}
Remarks

When left at its default value (Default), the actual value of the ViewStyle property resolves to 'Standard'.

Example
The following code sample demonstrates how to set the ViewStyle property of the UltraCalendarLook component and assign that instance of the UltraCalendarLook component to every UltraScheduleControlBase-derived control on the form.

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule

    Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click

        '	Toggle the value of the ultraCalendarLook component's
        '	ViewStyle property
        If Me.UltraCalendarLook1.ViewStyle = ViewStyle.Standard Then
            Me.UltraCalendarLook1.ViewStyle = ViewStyle.Office2003
        Else
            Me.UltraCalendarLook1.ViewStyle = ViewStyle.Standard
        End If

        '	Iterate through all the controls on this form, and if the
        '	control derives from UltraScheduleControlBase, set its
        '	CalendarLook property to the instance on which we just set the
        '	ViewStyle property.
        Dim control As Control
        For Each control In Me.Controls

            Try
                Dim ultraScheduleControl As UltraScheduleControlBase = CType(control, UltraScheduleControlBase)
                If Not ultraScheduleControl Is Nothing Then

                    '	Only set the CalendarLook property if it is not already set
                    If Not ultraScheduleControl.CalendarLook Is Me.UltraCalendarLook1 Then
                        ultraScheduleControl.CalendarLook = Me.UltraCalendarLook1
                    End If
                End If
            Catch
            End Try
        Next

    End Sub
using Infragistics.Win;
using Infragistics.Win.UltraWinSchedule;

		private void button1_Click(object sender, System.EventArgs e)
		{
			//	Toggle the value of the ultraCalendarLook component's
			//	ViewStyle property
			if ( this.ultraCalendarLook1.ViewStyle == ViewStyle.Standard )
				this.ultraCalendarLook1.ViewStyle = ViewStyle.Office2003;
			else
				this.ultraCalendarLook1.ViewStyle = ViewStyle.Standard;

			//	Iterate through all the controls on this form, and if the
			//	control derives from UltraScheduleControlBase, set its
			//	CalendarLook property to the instance on which we just set the
			//	ViewStyle property.
			foreach( Control control in this.Controls )
			{
				UltraScheduleControlBase ultraScheduleControl = control as UltraScheduleControlBase;
				if ( ultraScheduleControl != null )
				{
					//	Only set the CalendarLook property if it is not already set
					if ( ultraScheduleControl.CalendarLook != this.ultraCalendarLook1 )
						ultraScheduleControl.CalendarLook = this.ultraCalendarLook1;
				}
			}
		}
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