cad.net call the color dialog

        [CommandMethod("CDL")]
        public void ShowColorDialog()
        {
            Document doc = Application.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            Editor ed = doc.Editor;
            var cd = new Autodesk.AutoCAD.Windows.ColorDialog();
            System.Windows.Forms.DialogResult dr = cd.ShowDialog();
            if (dr == System.Windows.Forms.DialogResult.OK)
            {
                ed.WriteMessage("\nColor selected: " + cd.Color.ToString());
            }
        }

 

Guess you like

Origin www.cnblogs.com/JJBox/p/11610343.html