.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Eventhandler does not keep working when changed layout

0 REPLIES 0
Reply
Message 1 of 1
nijhuis
258 Views, 0 Replies

Eventhandler does not keep working when changed layout

Hi, This program (from autocad help) works fine until i changed to another layout. The addappevent and the removeappevent keeps working but the appsysvarchanged does not! Anyone knows how to solve this??

 

Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Public Class Useri1Event
    <CommandMethod("AddAppEvent")> Public Sub AddAppEvent()
        AddHandler Application.SystemVariableChanged, AddressOf appSysVarChanged
    End Sub

    <CommandMethod("RemoveAppEvent")> Public Sub RemoveAppEvent()
        RemoveHandler Application.SystemVariableChanged, AddressOf appSysVarChanged
    End Sub

    Public Sub appSysVarChanged(ByVal senderObj As Object, ByVal sysVarChEvtArgs As Autodesk.AutoCAD.ApplicationServices.SystemVariableChangedEventArgs)

        Dim oVal As Object = Application.GetSystemVariable(sysVarChEvtArgs.Name)

        '' Display a message box with the system variable name and the new value
        Application.ShowAlertDialog(sysVarChEvtArgs.Name & " was changed." & vbLf & "New value: " & oVal.ToString())


        'End If

    End Sub

End Class

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost