thomas.bucher
2008-09-05, 08:35 AM
I try to migrate the following VBA program to .NET but witout success.
Could help me?
Public Sub DEU_MDCNE_SwapLayoutBackgrnd()
'Initialize
'----------------------------------------------------------------
Dim preferences As AcadPreferences
Dim currGraphicsWinLayoutBackgrndColor As OLE_COLOR
Dim StdGrey As OLE_COLOR
On Error GoTo Error
Set preferences = ThisDrawing.Application.preferences
StdGrey = 12632256
' Retrieve the current GraphicsWinLayoutBackgrndColor value
currGraphicsWinLayoutBackgrndColor = preferences.Display.GraphicsWinLayoutBackgrndColor
' Change the value for GraphicsWinLayoutBackgrndColor
If currGraphicsWinLayoutBackgrndColor <> vbWhite Then
preferences.Display.GraphicsWinLayoutBackgrndColor = vbWhite
Else: preferences.Display.GraphicsWinLayoutBackgrndColor = StdGrey
End If
Exit Sub
Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure 'DEU_MDCNE_SwapLayoutBackgrnd'"
End Sub
Moderator Note:
Please use [ CODE ] tags... (http://forums.augi.com/misc.php?do=bbcode#code)
Could help me?
Public Sub DEU_MDCNE_SwapLayoutBackgrnd()
'Initialize
'----------------------------------------------------------------
Dim preferences As AcadPreferences
Dim currGraphicsWinLayoutBackgrndColor As OLE_COLOR
Dim StdGrey As OLE_COLOR
On Error GoTo Error
Set preferences = ThisDrawing.Application.preferences
StdGrey = 12632256
' Retrieve the current GraphicsWinLayoutBackgrndColor value
currGraphicsWinLayoutBackgrndColor = preferences.Display.GraphicsWinLayoutBackgrndColor
' Change the value for GraphicsWinLayoutBackgrndColor
If currGraphicsWinLayoutBackgrndColor <> vbWhite Then
preferences.Display.GraphicsWinLayoutBackgrndColor = vbWhite
Else: preferences.Display.GraphicsWinLayoutBackgrndColor = StdGrey
End If
Exit Sub
Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure 'DEU_MDCNE_SwapLayoutBackgrnd'"
End Sub
Moderator Note:
Please use [ CODE ] tags... (http://forums.augi.com/misc.php?do=bbcode#code)