| Infragistics.Win.Misc Namespace > UltraDesktopAlert Class : Style Property (UltraDesktopAlert) |
Gets/sets the style of the desktop alert windows displayed by this UltraDesktopAlert instance.
[Visual Basic]
Public Property Style As DesktopAlertStyle[C#]
public DesktopAlertStyle Style {get; set;}The UltraDesktopAlert component supports two display styles, 'Office2007' and 'WindowsLiveMessenger'. When the Style property is set to 'Office2007', the desktop alert windows emulate the look and feel of the Outlook 2007 New Mail Desktop Alert. When the Style property is set to 'WindowsLiveMessenger', the desktop alert windows emulate the look and feel of the Windows Live Messenger notification window.
Note: Changing properties of the UltraDesktopAlert component when one or more desktop alert windows are open is not recommended; such changes will not be fully applied for desktop alert windows that are currently open. The HasOpenWindows property should be used to determine whether any desktop alert windows are currently open for this instance before changing property values.
The following code sample demonstrates how the appearance related properties of the UltraDesktopAlert component can be used to customize the appearance of all desktop alert windows displayed by the component:
[Visual Basic]
Imports Infragistics.Win
Imports Infragistics.Win.Misc
Private Sub SetAppearances()
' Use the link appearances to get a consistent foreground color across
' all links, and also so the font attributes are realized through the
' formatting and not the appearances.
Dim normalLinkAppearance As New Infragistics.Win.Appearance()
normalLinkAppearance.FontData.Bold = DefaultableBoolean.False
normalLinkAppearance.FontData.Italic = DefaultableBoolean.False
normalLinkAppearance.FontData.Underline = DefaultableBoolean.False
normalLinkAppearance.ForeColor = SystemColors.WindowText
Me.desktopAlert.CaptionAppearance = normalLinkAppearance
Me.desktopAlert.TextAppearance = normalLinkAppearance
Me.desktopAlert.FooterTextAppearance = normalLinkAppearance
' Use the link hot track appearances to get a consistent foreground
' color across all links
Dim hotTrackLinkAppearance As New Infragistics.Win.Appearance()
hotTrackLinkAppearance.FontData.Bold = DefaultableBoolean.False
hotTrackLinkAppearance.FontData.Italic = DefaultableBoolean.False
hotTrackLinkAppearance.FontData.Underline = DefaultableBoolean.True
hotTrackLinkAppearance.ForeColor = Color.Blue
Me.desktopAlert.CaptionHotTrackAppearance = hotTrackLinkAppearance
Me.desktopAlert.TextHotTrackAppearance = hotTrackLinkAppearance
Me.desktopAlert.FooterTextHotTrackAppearance = hotTrackLinkAppearance
' Store the Appearance objects we created in the Appearances
' collection
Me.desktopAlert.Appearances.Add(normalLinkAppearance)
Me.desktopAlert.Appearances.Add(hotTrackLinkAppearance)
' Set the GripAreaAppearance or CaptionAreaAppearance depending
' on the resolved Style...the GripAreaAppearance applies to the
' Office2007 style, and the CaptionAreaAppearance applies to the
' WindowsLiveMessenger style.
If (Me.desktopAlert.StyleResolved = DesktopAlertStyle.Office2007) Then
Dim gripAreaAppearance As New Infragistics.Win.Appearance()
gripAreaAppearance.BackColor = Color.White
gripAreaAppearance.BackColor = Office2007ColorTable.Colors.ToolbarGradientLight
gripAreaAppearance.BackGradientStyle = GradientStyle.VerticalBump
Me.desktopAlert.GripAreaAppearance = gripAreaAppearance
Else
Dim captionAreaAppearance As New Infragistics.Win.Appearance()
captionAreaAppearance.BackColor = Color.AliceBlue
Me.desktopAlert.CaptionAreaAppearance = captionAreaAppearance
Me.desktopAlert.CaptionAreaImageSize = New Size(12, 12)
End If
End Sub
[C#]
using Infragistics.Win;
using Infragistics.Win.Misc;
using System.Diagnostics;
private void SetAppearances()
{
// Use the link appearances to get a consistent foreground color across
// all links, and also so the font attributes are realized through the
// formatting and not the appearances.
Infragistics.Win.Appearance normalLinkAppearance = new Infragistics.Win.Appearance();
normalLinkAppearance.FontData.Bold = DefaultableBoolean.False;
normalLinkAppearance.FontData.Italic = DefaultableBoolean.False;
normalLinkAppearance.FontData.Underline = DefaultableBoolean.False;
normalLinkAppearance.ForeColor = SystemColors.WindowText;
this.desktopAlert.CaptionAppearance = normalLinkAppearance;
this.desktopAlert.TextAppearance = normalLinkAppearance;
this.desktopAlert.FooterTextAppearance = normalLinkAppearance;
// Use the link hot track appearances to get a consistent foreground
// color across all links
Infragistics.Win.Appearance hotTrackLinkAppearance = new Infragistics.Win.Appearance();
hotTrackLinkAppearance.FontData.Bold = DefaultableBoolean.False;
hotTrackLinkAppearance.FontData.Italic = DefaultableBoolean.False;
hotTrackLinkAppearance.FontData.Underline = DefaultableBoolean.True;
hotTrackLinkAppearance.ForeColor = Color.Blue;
this.desktopAlert.CaptionHotTrackAppearance = hotTrackLinkAppearance;
this.desktopAlert.TextHotTrackAppearance = hotTrackLinkAppearance;
this.desktopAlert.FooterTextHotTrackAppearance = hotTrackLinkAppearance;
// Store the Appearance objects we created in the Appearances
// collection
this.desktopAlert.Appearances.Add( normalLinkAppearance );
this.desktopAlert.Appearances.Add( hotTrackLinkAppearance );
// Set the GripAreaAppearance or CaptionAreaAppearance depending
// on the resolved Style...the GripAreaAppearance applies to the
// Office2007 style, and the CaptionAreaAppearance applies to the
// WindowsLiveMessenger style.
if ( this.desktopAlert.StyleResolved == DesktopAlertStyle.Office2007 )
{
Infragistics.Win.Appearance gripAreaAppearance = new Infragistics.Win.Appearance();
gripAreaAppearance.BackColor = Color.White;
gripAreaAppearance.BackColor = Office2007ColorTable.Colors.ToolbarGradientLight;
gripAreaAppearance.BackGradientStyle = GradientStyle.VerticalBump;
this.desktopAlert.GripAreaAppearance = gripAreaAppearance;
}
else
{
Infragistics.Win.Appearance captionAreaAppearance = new Infragistics.Win.Appearance();
captionAreaAppearance.BackColor = Color.AliceBlue;
this.desktopAlert.CaptionAreaAppearance = captionAreaAppearance;
this.desktopAlert.CaptionAreaImageSize = new Size( 12, 12 );
}
}