Version

CloseWindow Property (DesktopAlertLinkClickedEventArgs)

Gets/sets whether the desktop alert window should be closed when execution returns from this event.
Syntax
'Declaration
 
Public Property CloseWindow As Boolean
public bool CloseWindow {get; set;}
Example
The following code sample demonstrates how the DesktopAlertLinkClicked event can be used to perform an action when a link is clicked, and how to control whether the desktop alert window is closed:

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Imports Infragistics.Win
Imports Infragistics.Win.Misc

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
			'	Handle the DesktopAlertLinkClicked event
        AddHandler Me.desktopAlert.DesktopAlertLinkClicked, AddressOf Me.OnDesktopAlertLinkClicked

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

        '  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>"

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

    Private Sub OnDesktopAlertLinkClicked(ByVal sender As Object, ByVal e As DesktopAlertLinkClickedEventArgs)
        Select Case e.LinkType

            '  If the caption or text link was clicked, close the desktop
            '  alert window, and do not attempt to open the link.
            Case DesktopAlertLinkType.Caption
            Case DesktopAlertLinkType.Text

                Me.OnLinkClicked(e.LinkType)
                e.LinkClickedArgs.OpenLink = False
                e.CloseWindow = True


                '  If the footer text link was clicked, open the link,
                '  and do not close the desktop alert window. Also, pin
                '  the desktop alert window so it does not auto-close while
                '  we are performing the link's action.
            Case DesktopAlertLinkType.Footer
                e.LinkClickedArgs.OpenLink = True
                e.CloseWindow = False
                e.WindowInfo.Pinned = True
        End Select

    End Sub
using Infragistics.Win;
using Infragistics.Win.Misc;
using System.Diagnostics;

    private void Button1_Click(object sender, EventArgs e)
    {
			//		Handle the DesktopAlertLinkClicked event
        this.desktopAlert.DesktopAlertLinkClicked += new DesktopAlertLinkClickedHandler( this.OnDesktopAlertLinkClicked );

        //  Create a new instance of the UltraDesktopAlertShowWindowInfo class.
        UltraDesktopAlertShowWindowInfo showInfo = new UltraDesktopAlertShowWindowInfo();

        //  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>";

        //  Call the Show method to display the desktop alert
        this.desktopAlert.Show( showInfo );
    }

    //  Handles the 'DesktopAlertLinkClicked' event.
    private void OnDesktopAlertLinkClicked( object sender, DesktopAlertLinkClickedEventArgs e )
    {        
        switch ( e.LinkType )
        {
            //  If the caption or text link was clicked, close the desktop
            //  alert window, and do not attempt to open the link.
            case DesktopAlertLinkType.Caption:
            case DesktopAlertLinkType.Text:
            {
                this.OnLinkClicked( e.LinkType );
                e.LinkClickedArgs.OpenLink = false;
                e.CloseWindow = true;
            }
            break;

            //  If the footer text link was clicked, open the link,
            //  and do not close the desktop alert window. Also, pin
            //  the desktop alert window so it does not auto-close while
            //  we are performing the link's action.
            case DesktopAlertLinkType.Footer:
            {
                e.LinkClickedArgs.OpenLink = true;
                e.CloseWindow = false;
                e.WindowInfo.Pinned = true;
            }
            break;
        }
    }
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