See Also

UltraDesktopAlertShowWindowInfo Class  | UltraDesktopAlertShowWindowInfo Members  | ImageSize Property  | Appearance Property  | Image

Language

Visual Basic

C#

Show All

See Also Languages Infragistics2.Win.Misc.v7.2

Image Property

Infragistics.Win.Misc Namespace > UltraDesktopAlertShowWindowInfo Class : Image Property (UltraDesktopAlertShowWindowInfo)

Gets/sets the image which is displayed in the desktop alert window associated with this instance.

[Visual Basic]
Public Property Image As Image
[C#]
public Image Image {get; set;}

Remarks

The Image property provides a way for the end developer to specify a different image for each desktop alert window that is displayed. When the Image property is set to null (Nothing in VB), the value of the Image property of the UltraDesktopAlert.Appearance is displayed. The size at which the image is displayed is determined by the UltraDesktopAlert.ImageSize property.

By default, a border is drawn around the image when the UltraDesktopAlert.Style property is set to 'WindowsLiveMessenger'. The color of the border is determined by the UltraDesktopAlert.MainImageAreaBorderColor property.

Example

The following code sample demonstrates how the properties of the UltraDesktopAlertShowWindowInfo class can be used to customize the visual appearance and content for a particular desktop alert window:

[Visual Basic] 

Imports Infragistics.Win
Imports Infragistics.Win.Misc

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ' If a window with the same key as the one we are about to
        ' show is currently open, return
        If (Me.desktopAlert.IsOpen("myWindow")) Then Return

        ' Create a new instance of the UltraDesktopAlertShowWindowInfo class.
        Dim showInfo As UltraDesktopAlertShowWindowInfo = New UltraDesktopAlertShowWindowInfo()

        ' Set the key to uniquely identify this desktop alert window
        showInfo.Key = "myWindow"

        ' Set the Caption, Text, and FooterText properties using formatting
        ' characters that are recognized by the FormattedTextUIElement.
        showInfo.Caption = "<span style=""font-weight:bold_x003B_"">Caption</span> is bolded<br/>"
        showInfo.Text = "<span style=""text-decoration:underline_x003B_"">Line one of the Text is underlined</span><br/><span style=""font-style:italic_x003B_"">Line two is italicized</span><br/>"
        showInfo.FooterText = "<a href=""www.infragistics.com"">Click to visit the Infragistics website</a>"

        ' Use the ScreenPosition property to make the desktop alert
        ' window appear at the top left corner of the screen
        showInfo.ScreenPosition = ScreenPosition.TopLeft

        ' Use the Screen property to specify which screen the desktop alert
        ' appears in...in the case where the end user has amultiple monitor
        ' setup, this will make the alert appear on the last screen
        showInfo.Screen = Screen.AllScreens(Screen.AllScreens.Length - 1)

        ' Set the image that is displayed in the desktop alert window's
        ' client area, and the sound that is played as the window appears.
        showInfo.Image = New Icon("C:\Icons\DesktopAlert.ico").ToBitmap()
        showInfo.Sound = "C:\windows\media\notify.wav"

        ' The Pinned property can be used to circumvent the auto-close
        ' functionality for a particular desktop alert window. When
        ' Pinned is set to true, a pushpin graphic appears in the close
        ' button area to indicate that the window will stay open.
        showInfo.Pinned = Me.pinWindows

        ' The VisibleAlertButtons collection can be used to hide buttons
        ' for a particular desktop alert window, while not affecting the
        ' contents of the UltraDesktopAlert's AlertButtons collection.
        If (Me.allowAppClose = False) Then

            ' Since the UltraDesktopAlertShowWindowInfo is not yet associated
            ' with an UltraDesktopAlert, we must first populate the VisibleAlertButtons
            ' collection with its buttons
            showInfo.VisibleAlertButtons.InitializeFrom(Me.desktopAlert)

            ' Use the VisibleAlertButtons collection's Remove method to remove
            ' the close button for this particular window.
            showInfo.VisibleAlertButtons.Remove(showInfo.VisibleAlertButtons("close"))
        End If

        ' Show the window
        Me.desktopAlert.Show(showInfo)
    End Sub

[C#] 

using Infragistics.Win; 
using Infragistics.Win.Misc; 
using System.Diagnostics; 
 
    private void button1_Click(object sender, EventArgs e) 
    { 
        //  If a window with the same key as the one we are about to 
        //  show is currently open, return; 
        if ( this.desktopAlert.IsOpen("myWindow") ) 
            return; 
 
        //  Create a new instance of the UltraDesktopAlertShowWindowInfo class. 
        UltraDesktopAlertShowWindowInfo showInfo = new UltraDesktopAlertShowWindowInfo(); 
 
        //  Set the key to uniquely identify this desktop alert window 
        showInfo.Key = "myWindow"; 
 
        //  Set the Caption, Text, and FooterText properties using formatting 
        //  characters that are recognized by the FormattedTextUIElement. 
        showInfo.Caption = "<span style=\"font-weight:bold_x003B_\">Caption</span> is bolded<br/>"; 
        showInfo.Text = "<span style=\"text-decoration:underline_x003B_\">Line one of the Text is underlined</span><br/><span style=\"font-style:italic_x003B_\">Line two is italicized</span><br/>"; 
        showInfo.FooterText = "<a href=\"www.infragistics.com\">Click to visit the Infragistics website</a>"; 
 
        //  Use the ScreenPosition property to make the desktop alert 
        //  window appear at the top left corner of the screen 
        showInfo.ScreenPosition = ScreenPosition.TopLeft; 
 
        //  Use the Screen property to specify which screen the desktop alert 
        //  appears in...in the case where the end user has amultiple monitor 
        //  setup, this will make the alert appear on the last screen 
        showInfo.Screen = Screen.AllScreens[Screen.AllScreens.Length - 1]; 
 
        //  Set the image that is displayed in the desktop alert window's 
        //  client area, and the sound that is played as the window appears. 
        showInfo.Image = new Icon( @"C:\Icons\DesktopAlert.ico" ).ToBitmap(); 
        showInfo.Sound = @"C:\windows\media\notify.wav"; 
 
        //  The Pinned property can be used to circumvent the auto-close 
        //  functionality for a particular desktop alert window. When 
        //  Pinned is set to true, a pushpin graphic appears in the close 
        //  button area to indicate that the window will stay open. 
        showInfo.Pinned = this.pinWindows; 
 
        //  The VisibleAlertButtons collection can be used to hide buttons 
        //  for a particular desktop alert window, while not affecting the 
        //  contents of the UltraDesktopAlert's AlertButtons collection. 
        if ( this.allowAppClose == false ) 
        { 
            //  Since the UltraDesktopAlertShowWindowInfo is not yet associated 
            //  with an UltraDesktopAlert, we must first populate the VisibleAlertButtons 
            //  collection with its buttons 
            showInfo.VisibleAlertButtons.InitializeFrom( this.desktopAlert ); 
 
            //  Use the VisibleAlertButtons collection's Remove method to remove 
            //  the close button for this particular window. 
            showInfo.VisibleAlertButtons.Remove( showInfo.VisibleAlertButtons["close"] ); 
        } 
 
        //  Call the Show method to display the desktop alert 
        this.desktopAlert.Show( showInfo ); 
    } 

See Also

UltraDesktopAlertShowWindowInfo Class  | UltraDesktopAlertShowWindowInfo Members  | ImageSize Property  | Appearance Property  | Image

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