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