Here is a sample in C#
Daniel
Code:
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;
// A reference to COM
using Autodesk.AutoCAD.Interop;
using AcAp = Autodesk.AutoCAD.ApplicationServices;
[assembly: CommandClass(typeof(ExecMethod.Commands))]
namespace ExecMethod
{
public class Commands
{
[CommandMethod("doit")]
public static void PaneButton()
{
Editor ed = AcAp.Application.DocumentManager.MdiActiveDocument.Editor;
try
{
AcadPreferences pref = AcAp.Application.Preferences as AcadPreferences;
pref.Display.GraphicsWinLayoutBackgrndColor = 12632256;
}
catch (System.Exception ex)
{
ed.WriteMessage(ex.Message);
}
}
}
}