Solid Edge Framework Type Library
DisplayAlerts Property
Solid Edge Framework Type Library > Application Object : DisplayAlerts Property
Description
Enables or disables the display of alerts and messages.
Property type
Read-write property
Syntax
Visual Basic
Public Property DisplayAlerts As Boolean
Remarks
If this property is True, the application displays alerts and messages (often requiring user interaction).
Example
Option Infer On

Imports System
Imports System.Runtime.InteropServices

Namespace Examples
    Friend Class Program
        <STAThread>
        Shared Sub Main(ByVal args() As String)
            Dim application As SolidEdgeFramework.Application = Nothing

            Try
                ' See "Handling 'Application is Busy' and 'Call was Rejected By Callee' errors" topic.
                OleMessageFilter.Register()

                ' Attempt to connect to a running instance of Solid Edge.
                application = DirectCast(Marshal.GetActiveObject("SolidEdge.Application"), SolidEdgeFramework.Application)

                ' Get the current value.
                Dim displayAlerts = application.DisplayAlerts

                ' Explicitily turn off prompts.
                application.DisplayAlerts = False
            Catch ex As System.Exception
                Console.WriteLine(ex)
            Finally
                OleMessageFilter.Unregister()
            End Try
        End Sub
    End Class
End Namespace
using System;
using System.Runtime.InteropServices;

namespace Examples
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            SolidEdgeFramework.Application application = null;

            try
            {
                // See "Handling 'Application is Busy' and 'Call was Rejected By Callee' errors" topic.
                OleMessageFilter.Register();

                // Attempt to connect to a running instance of Solid Edge.
                application = (SolidEdgeFramework.Application)Marshal.GetActiveObject("SolidEdge.Application");

                // Get the current value.
                var displayAlerts = application.DisplayAlerts;

                // Explicitily turn off prompts.
                application.DisplayAlerts = false;
            }
            catch (System.Exception ex)
            {
                Console.WriteLine(ex);
            }
            finally
            {
                OleMessageFilter.Unregister();
            }
        }
    }
}
See Also

Application Object  | Application Members