<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: strange problem of double click event in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364519#M84521</link>
    <description>This seems to work fine form me:&lt;BR /&gt;
&lt;BR /&gt;
public class TestDoubleClick&lt;BR /&gt;
    {&lt;BR /&gt;
        Autodesk.AutoCAD.Interop.AcadDocument m_doc;&lt;BR /&gt;
        [CommandMethod("testdblclick")]&lt;BR /&gt;
        public void DoIt()&lt;BR /&gt;
        {&lt;BR /&gt;
            if (m_doc == null)&lt;BR /&gt;
            {&lt;BR /&gt;
                m_doc = &lt;BR /&gt;
(Autodesk.AutoCAD.Interop.AcadDocument)AcadApp.DocumentManager.MdiActiveDocument.AcadDocument;&lt;BR /&gt;
                m_doc.BeginDoubleClick+=new &lt;BR /&gt;
_DAcadDocumentEvents_BeginDoubleClickEventHandler(m_doc_BeginDoubleClick);&lt;BR /&gt;
                AcadApp.DocumentManager.MdiActiveDocument.Editor.WriteMessage("Double &lt;BR /&gt;
click event is now hooked.");&lt;BR /&gt;
            }&lt;BR /&gt;
            else&lt;BR /&gt;
            {&lt;BR /&gt;
&lt;BR /&gt;
                m_doc.BeginDoubleClick-=new &lt;BR /&gt;
_DAcadDocumentEvents_BeginDoubleClickEventHandler(m_doc_BeginDoubleClick);&lt;BR /&gt;
                m_doc = null;&lt;BR /&gt;
                AcadApp.DocumentManager.MdiActiveDocument.Editor.WriteMessage("Double &lt;BR /&gt;
click event is now unhooked.");&lt;BR /&gt;
            }&lt;BR /&gt;
        }&lt;BR /&gt;
        class MTextEditor : Form&lt;BR /&gt;
        {&lt;BR /&gt;
            TextBox m_textBox;&lt;BR /&gt;
            public MTextEditor()&lt;BR /&gt;
            {&lt;BR /&gt;
                m_textBox = new TextBox();&lt;BR /&gt;
                this.SuspendLayout();&lt;BR /&gt;
                m_textBox.Location = new System.Drawing.Point(0, 0);&lt;BR /&gt;
                m_textBox.Name = "textBox";&lt;BR /&gt;
                m_textBox.TabIndex = 0;&lt;BR /&gt;
                m_textBox.Multiline = true;&lt;BR /&gt;
                m_textBox.Dock = DockStyle.Fill;&lt;BR /&gt;
&lt;BR /&gt;
                ClientSize = new System.Drawing.Size(100, 100);&lt;BR /&gt;
                Controls.Add(this.m_textBox);&lt;BR /&gt;
                Name = "MTextEditor";&lt;BR /&gt;
                Text = "MText Editor";&lt;BR /&gt;
                this.ResumeLayout(false);&lt;BR /&gt;
            }&lt;BR /&gt;
            public string Contents&lt;BR /&gt;
            {&lt;BR /&gt;
                get {return m_textBox.Text;}&lt;BR /&gt;
                set {m_textBox.Text = value;}&lt;BR /&gt;
            }&lt;BR /&gt;
        }&lt;BR /&gt;
        private void m_doc_BeginDoubleClick(object PickPoint)&lt;BR /&gt;
        {&lt;BR /&gt;
            Document activeDoc = AcadApp.DocumentManager.MdiActiveDocument;&lt;BR /&gt;
            //get the object that the user has selected&lt;BR /&gt;
            PromptSelectionResult res = activeDoc.Editor.SelectImplied();&lt;BR /&gt;
            if (res.Status != PromptStatus.OK)&lt;BR /&gt;
                return;&lt;BR /&gt;
            if (res.Value.Count != 1)&lt;BR /&gt;
                return; //we don't handle multiple selected objects&lt;BR /&gt;
            ObjectId idSel =  res.Value[0].ObjectId;&lt;BR /&gt;
            using (DocumentLock docLock = activeDoc.LockDocument())&lt;BR /&gt;
            {&lt;BR /&gt;
                using (Transaction trans = &lt;BR /&gt;
activeDoc.TransactionManager.StartTransaction())&lt;BR /&gt;
                {&lt;BR /&gt;
                    DBObject obj = trans.GetObject(idSel,OpenMode.ForWrite);&lt;BR /&gt;
                    MText text = obj as MText;&lt;BR /&gt;
                    if (text == null)&lt;BR /&gt;
                        return; //not an mtext&lt;BR /&gt;
                    using (MTextEditor form = new MTextEditor())&lt;BR /&gt;
                    {&lt;BR /&gt;
                        form.Contents = text.Contents;&lt;BR /&gt;
                        AcadApp.ShowModalDialog(form);&lt;BR /&gt;
                        text.Contents = form.Contents;&lt;BR /&gt;
                    }&lt;BR /&gt;
                    trans.Commit();&lt;BR /&gt;
                }&lt;BR /&gt;
            }&lt;BR /&gt;
        }&lt;BR /&gt;
    }&lt;BR /&gt;
&lt;NETCAI&gt; wrote in message news:4889347@discussion.autodesk.com...&lt;BR /&gt;
no body help me?&lt;/NETCAI&gt;</description>
    <pubDate>Thu, 30 Jun 2005 21:33:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2005-06-30T21:33:58Z</dc:date>
    <item>
      <title>strange problem of double click event</title>
      <link>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364517#M84519</link>
      <description>I use activex's double click event to define my own text editor function , but my code is work well only in no form state, once i use my own form , double click event will stop work.&lt;BR /&gt;
&lt;BR /&gt;
the following is my code :&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
using System;&lt;BR /&gt;
using System.Windows.Forms;&lt;BR /&gt;
using System.Collections;&lt;BR /&gt;
using System.IO;&lt;BR /&gt;
&lt;BR /&gt;
using Autodesk.AutoCAD.DatabaseServices;&lt;BR /&gt;
using Autodesk.AutoCAD.ApplicationServices;&lt;BR /&gt;
using Autodesk.AutoCAD.Runtime;&lt;BR /&gt;
using Autodesk.AutoCAD.Colors;&lt;BR /&gt;
using Autodesk.AutoCAD.Geometry;&lt;BR /&gt;
using Autodesk.AutoCAD.GraphicsInterface;&lt;BR /&gt;
using Autodesk.AutoCAD.LayerManager;&lt;BR /&gt;
using Autodesk.AutoCAD.PlottingServices;&lt;BR /&gt;
using Autodesk.AutoCAD.Windows;&lt;BR /&gt;
using Autodesk.AutoCAD.EditorInput;&lt;BR /&gt;
using Autodesk.AutoCAD.Publishing;&lt;BR /&gt;
&lt;BR /&gt;
using Autodesk.AutoCAD.Interop;&lt;BR /&gt;
using Autodesk.AutoCAD.Interop.Common;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
//using CaiSoft.Cad.AcadUtilities;&lt;BR /&gt;
&lt;BR /&gt;
using AcadArxApp = Autodesk.AutoCAD.ApplicationServices.Application;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
namespace CaiSoft.Cad.CaiCommands.General&lt;BR /&gt;
{&lt;BR /&gt;
    public class DoubleClick&lt;BR /&gt;
    {&lt;BR /&gt;
        public static EventsWatcher ew;&lt;BR /&gt;
&lt;BR /&gt;
        [CommandMethod("Cai_StartDoubleClick", CommandFlags.Session)]&lt;BR /&gt;
        public static void StartDoubleClick()&lt;BR /&gt;
        {&lt;BR /&gt;
&lt;BR /&gt;
            if (ew == null)&lt;BR /&gt;
            {&lt;BR /&gt;
                ew = new EventsWatcher();&lt;BR /&gt;
                ew.StartEvent();&lt;BR /&gt;
            }&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
        public static void DoubleClickEdit(Point3d pickPoint)&lt;BR /&gt;
        {&lt;BR /&gt;
            ObjectId id = GetEntityOnPickPoint(pickPoint);&lt;BR /&gt;
            AcadApplication app = (AcadApplication)AcadArxApp.AcadApplication;&lt;BR /&gt;
            bool loaded = false;&lt;BR /&gt;
            string dbclickArxName = "ACDBLCLKEDIT.ARX";&lt;BR /&gt;
            foreach (object obj in (string[])app.ListArx())&lt;BR /&gt;
            {&lt;BR /&gt;
                string name = (string)obj;&lt;BR /&gt;
                if (name.ToUpper() == dbclickArxName.ToUpper())&lt;BR /&gt;
                {&lt;BR /&gt;
                    loaded = true;&lt;BR /&gt;
                    break;&lt;BR /&gt;
                }&lt;BR /&gt;
            }&lt;BR /&gt;
            if (loaded)&lt;BR /&gt;
            {&lt;BR /&gt;
                app.UnloadArx(dbclickArxName);&lt;BR /&gt;
&lt;BR /&gt;
            }&lt;BR /&gt;
&lt;BR /&gt;
            if (id == ObjectId.Null)&lt;BR /&gt;
            {&lt;BR /&gt;
                AcadArxApp.DocumentManager.MdiActiveDocument.Editor.WriteMessage("\nPlease select a single entity！\n");&lt;BR /&gt;
                return;&lt;BR /&gt;
            }&lt;BR /&gt;
            else&lt;BR /&gt;
            {&lt;BR /&gt;
                AcadArxApp.DocumentManager.MdiActiveDocument.Editor.WriteMessage("\n" + id.ToString() + "\n");&lt;BR /&gt;
            }&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
            Transaction trans = HostApplicationServices.WorkingDatabase.TransactionManager.StartTransaction();&lt;BR /&gt;
            try&lt;BR /&gt;
            {&lt;BR /&gt;
                Entity ent = trans.GetObject(id, OpenMode.ForWrite, false) as Entity;&lt;BR /&gt;
&lt;BR /&gt;
                if (ent is DBText)&lt;BR /&gt;
                {&lt;BR /&gt;
                    //((DBText)ent).TextString += "test "; // this line works fine.&lt;BR /&gt;
                    EditText(id, trans);                 // this line only works some time.&lt;BR /&gt;
                }&lt;BR /&gt;
                else if (ent is MText)&lt;BR /&gt;
                {&lt;BR /&gt;
                    EditText(id, trans);&lt;BR /&gt;
                }&lt;BR /&gt;
&lt;BR /&gt;
                trans.Commit();&lt;BR /&gt;
            }&lt;BR /&gt;
            catch (System.Exception e)&lt;BR /&gt;
            {&lt;BR /&gt;
               MessageBox.Show(e.Message);&lt;BR /&gt;
            }&lt;BR /&gt;
&lt;BR /&gt;
            finally { trans.Dispose(); }&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
        private static ObjectId GetEntityOnPickPoint(Point3d pickPoint)&lt;BR /&gt;
        {&lt;BR /&gt;
            ObjectId id = ObjectId.Null;&lt;BR /&gt;
&lt;BR /&gt;
            PromptSelectionResult res = AcadArxApp.DocumentManager.MdiActiveDocument.Editor.SelectImplied();&lt;BR /&gt;
            if (res.Status == PromptStatus.OK)&lt;BR /&gt;
            {&lt;BR /&gt;
                if (res.Value.Count == 1)&lt;BR /&gt;
                {&lt;BR /&gt;
                    id = res.Value[0].ObjectId;&lt;BR /&gt;
                }&lt;BR /&gt;
            }&lt;BR /&gt;
            return id;&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
        public static void EditText(ObjectId objId, Transaction trans)&lt;BR /&gt;
        {&lt;BR /&gt;
            //TextEditorForm is my text editor form&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
            string text = "";&lt;BR /&gt;
            Entity ent = trans.GetObject(objId, OpenMode.ForWrite, false) as Entity;&lt;BR /&gt;
            TextEditorForm f = null;&lt;BR /&gt;
            if (ent is DBText)&lt;BR /&gt;
            {&lt;BR /&gt;
                text = ((DBText)ent).TextString;&lt;BR /&gt;
                f = new TextEditorForm(text, false);&lt;BR /&gt;
            }&lt;BR /&gt;
            else if (ent is MText)&lt;BR /&gt;
            {&lt;BR /&gt;
                text = ((MText)ent).Contents;&lt;BR /&gt;
                f = new TextEditorForm(text, true);&lt;BR /&gt;
            }&lt;BR /&gt;
            DialogResult dr = AcadArxApp.ShowModalDialog(f);&lt;BR /&gt;
            if (dr != DialogResult.OK)&lt;BR /&gt;
            {&lt;BR /&gt;
                return;&lt;BR /&gt;
            }&lt;BR /&gt;
&lt;BR /&gt;
            if (ent is DBText)&lt;BR /&gt;
            {&lt;BR /&gt;
                ((DBText)ent).TextString = "";&lt;BR /&gt;
                string[] temps = f.Res.text.Split('\n');&lt;BR /&gt;
                for (int i = 0; i &amp;lt; temps.Length; i++)&lt;BR /&gt;
                {&lt;BR /&gt;
                    ((DBText)ent).TextString += temps&lt;I&gt;;&lt;BR /&gt;
                }&lt;BR /&gt;
&lt;BR /&gt;
            }&lt;BR /&gt;
            else if (ent is MText)&lt;BR /&gt;
            {&lt;BR /&gt;
                ((MText)ent).Contents = f.Res.text;&lt;BR /&gt;
            }&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
    }&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
    // Helper class to workaround a Hashtable issue: &lt;BR /&gt;
    // Can't change values in a foreach loop or enumerator&lt;BR /&gt;
    class CBoolClass&lt;BR /&gt;
    {&lt;BR /&gt;
        public CBoolClass(bool val) { this.val = val; }&lt;BR /&gt;
        public bool val;&lt;BR /&gt;
        public override string ToString() { return (val.ToString()); }&lt;BR /&gt;
    }&lt;BR /&gt;
&lt;BR /&gt;
    /// &lt;SUMMARY&gt;&lt;BR /&gt;
    /// DocManForUI.&lt;BR /&gt;
    /// &lt;/SUMMARY&gt;&lt;BR /&gt;
    public class DocManEvents&lt;BR /&gt;
    {&lt;BR /&gt;
        public DocManEvents()&lt;BR /&gt;
        {&lt;BR /&gt;
            Do();&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
        public void Do()&lt;BR /&gt;
        {&lt;BR /&gt;
            try&lt;BR /&gt;
            {&lt;BR /&gt;
                DocumentCollection m_docMan = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager;&lt;BR /&gt;
&lt;BR /&gt;
                // Used to plant and remove Doc or DB events if applicable.&lt;BR /&gt;
                m_docMan.DocumentCreated += new DocumentCollectionEventHandler(callback_DocumentCreated);&lt;BR /&gt;
                m_docMan.DocumentToBeDestroyed += new DocumentCollectionEventHandler(callback_DocumentToBeDestroyed);&lt;BR /&gt;
&lt;BR /&gt;
            }&lt;BR /&gt;
            catch (System.Exception ex)&lt;BR /&gt;
            {&lt;BR /&gt;
                Helper.ErrorMessage(ex);&lt;BR /&gt;
            }&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
        public void Undo()&lt;BR /&gt;
        {&lt;BR /&gt;
            try&lt;BR /&gt;
            {&lt;BR /&gt;
                DocumentCollection m_docMan = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager;&lt;BR /&gt;
&lt;BR /&gt;
                // Used to plant and remove Doc or DB events if applicable.&lt;BR /&gt;
                m_docMan.DocumentCreated -= new DocumentCollectionEventHandler(callback_DocumentCreated);&lt;BR /&gt;
                m_docMan.DocumentToBeDestroyed -= new DocumentCollectionEventHandler(callback_DocumentToBeDestroyed);&lt;BR /&gt;
&lt;BR /&gt;
            }&lt;BR /&gt;
            catch (System.Exception ex)&lt;BR /&gt;
            {&lt;BR /&gt;
                Helper.ErrorMessage(ex);&lt;BR /&gt;
            }&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
        private void callback_DocumentCreated(Object sender, DocumentCollectionEventArgs e)&lt;BR /&gt;
        {&lt;BR /&gt;
            try&lt;BR /&gt;
            {&lt;BR /&gt;
                Document doc = e.Document;&lt;BR /&gt;
                EventsWatcher.documentCreated(ref doc);&lt;BR /&gt;
            }&lt;BR /&gt;
            catch (System.Exception ex)&lt;BR /&gt;
            {&lt;BR /&gt;
                Helper.ErrorMessage(ex);&lt;BR /&gt;
            }&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
        private void callback_DocumentToBeDestroyed(Object sender, DocumentCollectionEventArgs e)&lt;BR /&gt;
        {&lt;BR /&gt;
            try&lt;BR /&gt;
            {&lt;BR /&gt;
                Document doc = e.Document;&lt;BR /&gt;
                EventsWatcher.documentToBeDestroyed(ref doc);&lt;BR /&gt;
            }&lt;BR /&gt;
            catch (System.Exception ex)&lt;BR /&gt;
            {&lt;BR /&gt;
                Helper.ErrorMessage(ex);&lt;BR /&gt;
            }&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
    }	// end of class DocManForUI&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
    /// &lt;SUMMARY&gt;&lt;BR /&gt;
    /// DocumentEvents.&lt;BR /&gt;
    /// &lt;/SUMMARY&gt;&lt;BR /&gt;
    public class DocumentEvents&lt;BR /&gt;
    {&lt;BR /&gt;
        public DocumentEvents()&lt;BR /&gt;
        {&lt;BR /&gt;
            m_bDone = false;&lt;BR /&gt;
            m_docsTable = new Hashtable();&lt;BR /&gt;
            collectAllDocs();&lt;BR /&gt;
            Do();&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
        public void collectAllDocs()&lt;BR /&gt;
        {&lt;BR /&gt;
            try&lt;BR /&gt;
            {&lt;BR /&gt;
                DocumentCollection m_docCol = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager;&lt;BR /&gt;
                IEnumerator docEnum = m_docCol.GetEnumerator();&lt;BR /&gt;
                while (docEnum.MoveNext())&lt;BR /&gt;
                {&lt;BR /&gt;
                    Document doc = (Document)docEnum.Current;&lt;BR /&gt;
                    addDoc(ref doc);&lt;BR /&gt;
                }&lt;BR /&gt;
            }&lt;BR /&gt;
            catch (System.Exception ex)&lt;BR /&gt;
            {&lt;BR /&gt;
                Helper.ErrorMessage(ex);&lt;BR /&gt;
            }&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
        public void addDoc(ref Document doc)&lt;BR /&gt;
        {&lt;BR /&gt;
            if (!m_docsTable.ContainsKey(doc))&lt;BR /&gt;
                m_docsTable.Add(doc, new CBoolClass(false));&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
        public void removeDoc(ref Document doc)&lt;BR /&gt;
        {&lt;BR /&gt;
            if (m_docsTable.ContainsKey(doc))&lt;BR /&gt;
            {&lt;BR /&gt;
                UndoADoc(ref doc);&lt;BR /&gt;
                m_docsTable.Remove(doc);&lt;BR /&gt;
            }&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
        private Document m_doc;	// Used as a temporary var only.&lt;BR /&gt;
        private Hashtable m_docsTable;	// Document(key)/bool(value) pair&lt;BR /&gt;
        private bool m_bDone;	// A flag to indicate if events have been planted.&lt;BR /&gt;
        // A counterpart flag to the On option in the UI.&lt;BR /&gt;
        public void Do()&lt;BR /&gt;
        {&lt;BR /&gt;
            if (m_bDone == false)&lt;BR /&gt;
                m_bDone = true;&lt;BR /&gt;
            else // Don't return because we may need to address some new docs.&lt;BR /&gt;
            { }&lt;BR /&gt;
&lt;BR /&gt;
            try&lt;BR /&gt;
            {&lt;BR /&gt;
                foreach (DictionaryEntry entry in m_docsTable)&lt;BR /&gt;
                {&lt;BR /&gt;
                    CBoolClass boolClassVar = (CBoolClass)entry.Value;&lt;BR /&gt;
&lt;BR /&gt;
                    // Continue if events have alrealy planted for the specific doc&lt;BR /&gt;
                    if (boolClassVar.ToString().ToLower() == "true")&lt;BR /&gt;
                        continue;&lt;BR /&gt;
&lt;BR /&gt;
                    m_doc = (Document)entry.Key;&lt;BR /&gt;
                    AcadDocument acadDoc = (AcadDocument)m_doc.AcadDocument;&lt;BR /&gt;
                    acadDoc.BeginDoubleClick += new _DAcadDocumentEvents_BeginDoubleClickEventHandler(doc_BeginDoubleClick);&lt;BR /&gt;
&lt;BR /&gt;
                    boolClassVar.val = true;&lt;BR /&gt;
                }&lt;BR /&gt;
            }&lt;BR /&gt;
            catch (System.Exception ex)&lt;BR /&gt;
            {&lt;BR /&gt;
                //Helper.ErrorMessage(ex);&lt;BR /&gt;
            }&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
        public void Undo()&lt;BR /&gt;
        {&lt;BR /&gt;
            if (m_bDone == false)&lt;BR /&gt;
                return;&lt;BR /&gt;
            else&lt;BR /&gt;
                m_bDone = false;&lt;BR /&gt;
&lt;BR /&gt;
            try&lt;BR /&gt;
            {&lt;BR /&gt;
                IDictionaryEnumerator docsEnumerator = m_docsTable.GetEnumerator();&lt;BR /&gt;
                while (docsEnumerator.MoveNext())&lt;BR /&gt;
                {&lt;BR /&gt;
                    DictionaryEntry entry = (DictionaryEntry)docsEnumerator.Current;&lt;BR /&gt;
&lt;BR /&gt;
                    CBoolClass boolClassVar = (CBoolClass)entry.Value;&lt;BR /&gt;
&lt;BR /&gt;
                    // Continue if events have alrealy been removed from the specific doc&lt;BR /&gt;
                    if (boolClassVar.ToString().ToLower() == "false")&lt;BR /&gt;
                        continue;&lt;BR /&gt;
&lt;BR /&gt;
                    m_doc = (Document)entry.Key;&lt;BR /&gt;
&lt;BR /&gt;
                    AcadDocument acadDoc = (AcadDocument)m_doc.AcadDocument;&lt;BR /&gt;
                    acadDoc.BeginDoubleClick -= new _DAcadDocumentEvents_BeginDoubleClickEventHandler(doc_BeginDoubleClick);&lt;BR /&gt;
                    boolClassVar.val = false;&lt;BR /&gt;
&lt;BR /&gt;
                }&lt;BR /&gt;
            }&lt;BR /&gt;
            catch (System.Exception ex)&lt;BR /&gt;
            {&lt;BR /&gt;
                //Helper.ErrorMessage(ex);&lt;BR /&gt;
            }&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
        public void UndoADoc(ref Document doc)&lt;BR /&gt;
        {&lt;BR /&gt;
            try&lt;BR /&gt;
            {&lt;BR /&gt;
                if (!m_docsTable.Contains(doc))&lt;BR /&gt;
                    return;&lt;BR /&gt;
&lt;BR /&gt;
                CBoolClass boolClassVar = (CBoolClass)m_docsTable[doc];&lt;BR /&gt;
&lt;BR /&gt;
                // Return if events have not been planted for it.&lt;BR /&gt;
                if (boolClassVar.ToString().ToLower() == "false")&lt;BR /&gt;
                    return;&lt;BR /&gt;
&lt;BR /&gt;
                m_doc = doc;&lt;BR /&gt;
&lt;BR /&gt;
                AcadDocument acadDoc = (AcadDocument)m_doc.AcadDocument;&lt;BR /&gt;
                acadDoc.BeginDoubleClick -= new _DAcadDocumentEvents_BeginDoubleClickEventHandler(doc_BeginDoubleClick);&lt;BR /&gt;
&lt;BR /&gt;
                boolClassVar.val = false;&lt;BR /&gt;
            }&lt;BR /&gt;
            catch (System.Exception ex)&lt;BR /&gt;
            {&lt;BR /&gt;
                Helper.ErrorMessage(ex);&lt;BR /&gt;
            }&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
        void doc_BeginDoubleClick(object PickPoint)&lt;BR /&gt;
        {&lt;BR /&gt;
            //Arx.Editor.WriteMessage("\ndouble click started!");&lt;BR /&gt;
            double[] pnt = (double[])PickPoint;&lt;BR /&gt;
            Point3d pickPoint = new Point3d(pnt[0], pnt[1], pnt[2]);&lt;BR /&gt;
&lt;BR /&gt;
            DocumentLock docLock = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();&lt;BR /&gt;
            DoubleClick.DoubleClickEdit(pickPoint);&lt;BR /&gt;
            docLock.Dispose();&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
    }	// end of class DocumentEvents&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
    /// &lt;SUMMARY&gt;&lt;BR /&gt;
    /// EventsWatcher.&lt;BR /&gt;
    /// &lt;/SUMMARY&gt;&lt;BR /&gt;
    public class EventsWatcher&lt;BR /&gt;
    {&lt;BR /&gt;
&lt;BR /&gt;
        public EventsWatcher()&lt;BR /&gt;
        {&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
        // Static global event watchers&lt;BR /&gt;
        public static DocumentEvents m_docWatcher;&lt;BR /&gt;
        public static DocManEvents m_docManWatcher;&lt;BR /&gt;
&lt;BR /&gt;
        // Helper functions&lt;BR /&gt;
        public static void documentCreated(ref Autodesk.AutoCAD.ApplicationServices.Document doc)&lt;BR /&gt;
        {&lt;BR /&gt;
            if (m_docWatcher != null)&lt;BR /&gt;
            {&lt;BR /&gt;
                m_docWatcher.addDoc(ref doc);&lt;BR /&gt;
                m_docWatcher.Do();&lt;BR /&gt;
            }&lt;BR /&gt;
&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
        public static void documentToBeDestroyed(ref Autodesk.AutoCAD.ApplicationServices.Document doc)&lt;BR /&gt;
        {&lt;BR /&gt;
            if (m_docWatcher != null)&lt;BR /&gt;
            {&lt;BR /&gt;
                m_docWatcher.removeDoc(ref doc);&lt;BR /&gt;
            }&lt;BR /&gt;
&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
        public void StartEvent()&lt;BR /&gt;
        {&lt;BR /&gt;
            docManWatcherOnDuty();&lt;BR /&gt;
            docWatcherOnDuty();&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
        private void docManWatcherOnDuty()&lt;BR /&gt;
        {&lt;BR /&gt;
            if (m_docManWatcher == null)&lt;BR /&gt;
            {&lt;BR /&gt;
                m_docManWatcher = new DocManEvents();&lt;BR /&gt;
            }&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
        private void docWatcherOnDuty()&lt;BR /&gt;
        {&lt;BR /&gt;
            if (m_docWatcher == null)&lt;BR /&gt;
            {&lt;BR /&gt;
                m_docWatcher = new DocumentEvents();&lt;BR /&gt;
            }&lt;BR /&gt;
        }&lt;BR /&gt;
    }&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
    /// &lt;SUMMARY&gt;&lt;BR /&gt;
    /// Helper class including some static helper functions.&lt;BR /&gt;
    /// &lt;/SUMMARY&gt;&lt;BR /&gt;
    public class Helper&lt;BR /&gt;
    {&lt;BR /&gt;
        public static void StreamMessage(string str)&lt;BR /&gt;
        {&lt;BR /&gt;
            try&lt;BR /&gt;
            {&lt;BR /&gt;
                // Application.DocumentManager.Count should be used to check zero doc status&lt;BR /&gt;
                // MdiActiveDocument returns non null sometimes even if in zero doc status!&lt;BR /&gt;
                if ( AcadArxApp.DocumentManager.MdiActiveDocument != null&lt;BR /&gt;
                    &amp;amp;&amp;amp; AcadArxApp.DocumentManager.Count != 0)&lt;BR /&gt;
                    Helper.CmdLineMessage(str);&lt;BR /&gt;
                else&lt;BR /&gt;
                    Helper.InfoMessageBox(str);&lt;BR /&gt;
&lt;BR /&gt;
            }&lt;BR /&gt;
            catch (System.Exception ex)&lt;BR /&gt;
            {&lt;BR /&gt;
                Helper.ErrorMessage(ex);&lt;BR /&gt;
            }&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
        public static void ErrorMessage(System.Exception ex)&lt;BR /&gt;
        {&lt;BR /&gt;
            try&lt;BR /&gt;
            {&lt;BR /&gt;
                System.Windows.Forms.MessageBox.Show(&lt;BR /&gt;
                    ex.ToString(),&lt;BR /&gt;
                    "Error",&lt;BR /&gt;
                    System.Windows.Forms.MessageBoxButtons.OK,&lt;BR /&gt;
                    System.Windows.Forms.MessageBoxIcon.Error);&lt;BR /&gt;
            }&lt;BR /&gt;
            catch&lt;BR /&gt;
            {&lt;BR /&gt;
            }&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
        public static void InfoMessageBox(string str)&lt;BR /&gt;
        {&lt;BR /&gt;
            try&lt;BR /&gt;
            {&lt;BR /&gt;
                System.Windows.Forms.MessageBox.Show(&lt;BR /&gt;
                    str,&lt;BR /&gt;
                    "Events Watcher",&lt;BR /&gt;
                    System.Windows.Forms.MessageBoxButtons.OK,&lt;BR /&gt;
                    System.Windows.Forms.MessageBoxIcon.Information);&lt;BR /&gt;
            }&lt;BR /&gt;
            catch (System.Exception ex)&lt;BR /&gt;
            {&lt;BR /&gt;
                Helper.ErrorMessage(ex);&lt;BR /&gt;
            }&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
        // Please check the valibility of Editor object before calling this.&lt;BR /&gt;
        public static void CmdLineMessage(string str)&lt;BR /&gt;
        {&lt;BR /&gt;
            try&lt;BR /&gt;
            {&lt;BR /&gt;
                if (AcadArxApp.DocumentManager.MdiActiveDocument != null&lt;BR /&gt;
                    &amp;amp;&amp;amp; AcadArxApp.DocumentManager.Count != 0&lt;BR /&gt;
                    &amp;amp;&amp;amp; AcadArxApp.DocumentManager.MdiActiveDocument.Editor != null)&lt;BR /&gt;
                {&lt;BR /&gt;
                    AcadArxApp.DocumentManager.MdiActiveDocument.Editor.WriteMessage(str);&lt;BR /&gt;
                }&lt;BR /&gt;
                else&lt;BR /&gt;
                    return;&lt;BR /&gt;
            }&lt;BR /&gt;
            catch (System.Exception ex)&lt;BR /&gt;
            {&lt;BR /&gt;
                Helper.ErrorMessage(ex);&lt;BR /&gt;
            }&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
    }&lt;BR /&gt;
&lt;BR /&gt;
}&lt;/I&gt;</description>
      <pubDate>Mon, 27 Jun 2005 13:26:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364517#M84519</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-27T13:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: strange problem of double click event</title>
      <link>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364518#M84520</link>
      <description>no body help me?</description>
      <pubDate>Thu, 30 Jun 2005 07:14:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364518#M84520</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-30T07:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: strange problem of double click event</title>
      <link>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364519#M84521</link>
      <description>This seems to work fine form me:&lt;BR /&gt;
&lt;BR /&gt;
public class TestDoubleClick&lt;BR /&gt;
    {&lt;BR /&gt;
        Autodesk.AutoCAD.Interop.AcadDocument m_doc;&lt;BR /&gt;
        [CommandMethod("testdblclick")]&lt;BR /&gt;
        public void DoIt()&lt;BR /&gt;
        {&lt;BR /&gt;
            if (m_doc == null)&lt;BR /&gt;
            {&lt;BR /&gt;
                m_doc = &lt;BR /&gt;
(Autodesk.AutoCAD.Interop.AcadDocument)AcadApp.DocumentManager.MdiActiveDocument.AcadDocument;&lt;BR /&gt;
                m_doc.BeginDoubleClick+=new &lt;BR /&gt;
_DAcadDocumentEvents_BeginDoubleClickEventHandler(m_doc_BeginDoubleClick);&lt;BR /&gt;
                AcadApp.DocumentManager.MdiActiveDocument.Editor.WriteMessage("Double &lt;BR /&gt;
click event is now hooked.");&lt;BR /&gt;
            }&lt;BR /&gt;
            else&lt;BR /&gt;
            {&lt;BR /&gt;
&lt;BR /&gt;
                m_doc.BeginDoubleClick-=new &lt;BR /&gt;
_DAcadDocumentEvents_BeginDoubleClickEventHandler(m_doc_BeginDoubleClick);&lt;BR /&gt;
                m_doc = null;&lt;BR /&gt;
                AcadApp.DocumentManager.MdiActiveDocument.Editor.WriteMessage("Double &lt;BR /&gt;
click event is now unhooked.");&lt;BR /&gt;
            }&lt;BR /&gt;
        }&lt;BR /&gt;
        class MTextEditor : Form&lt;BR /&gt;
        {&lt;BR /&gt;
            TextBox m_textBox;&lt;BR /&gt;
            public MTextEditor()&lt;BR /&gt;
            {&lt;BR /&gt;
                m_textBox = new TextBox();&lt;BR /&gt;
                this.SuspendLayout();&lt;BR /&gt;
                m_textBox.Location = new System.Drawing.Point(0, 0);&lt;BR /&gt;
                m_textBox.Name = "textBox";&lt;BR /&gt;
                m_textBox.TabIndex = 0;&lt;BR /&gt;
                m_textBox.Multiline = true;&lt;BR /&gt;
                m_textBox.Dock = DockStyle.Fill;&lt;BR /&gt;
&lt;BR /&gt;
                ClientSize = new System.Drawing.Size(100, 100);&lt;BR /&gt;
                Controls.Add(this.m_textBox);&lt;BR /&gt;
                Name = "MTextEditor";&lt;BR /&gt;
                Text = "MText Editor";&lt;BR /&gt;
                this.ResumeLayout(false);&lt;BR /&gt;
            }&lt;BR /&gt;
            public string Contents&lt;BR /&gt;
            {&lt;BR /&gt;
                get {return m_textBox.Text;}&lt;BR /&gt;
                set {m_textBox.Text = value;}&lt;BR /&gt;
            }&lt;BR /&gt;
        }&lt;BR /&gt;
        private void m_doc_BeginDoubleClick(object PickPoint)&lt;BR /&gt;
        {&lt;BR /&gt;
            Document activeDoc = AcadApp.DocumentManager.MdiActiveDocument;&lt;BR /&gt;
            //get the object that the user has selected&lt;BR /&gt;
            PromptSelectionResult res = activeDoc.Editor.SelectImplied();&lt;BR /&gt;
            if (res.Status != PromptStatus.OK)&lt;BR /&gt;
                return;&lt;BR /&gt;
            if (res.Value.Count != 1)&lt;BR /&gt;
                return; //we don't handle multiple selected objects&lt;BR /&gt;
            ObjectId idSel =  res.Value[0].ObjectId;&lt;BR /&gt;
            using (DocumentLock docLock = activeDoc.LockDocument())&lt;BR /&gt;
            {&lt;BR /&gt;
                using (Transaction trans = &lt;BR /&gt;
activeDoc.TransactionManager.StartTransaction())&lt;BR /&gt;
                {&lt;BR /&gt;
                    DBObject obj = trans.GetObject(idSel,OpenMode.ForWrite);&lt;BR /&gt;
                    MText text = obj as MText;&lt;BR /&gt;
                    if (text == null)&lt;BR /&gt;
                        return; //not an mtext&lt;BR /&gt;
                    using (MTextEditor form = new MTextEditor())&lt;BR /&gt;
                    {&lt;BR /&gt;
                        form.Contents = text.Contents;&lt;BR /&gt;
                        AcadApp.ShowModalDialog(form);&lt;BR /&gt;
                        text.Contents = form.Contents;&lt;BR /&gt;
                    }&lt;BR /&gt;
                    trans.Commit();&lt;BR /&gt;
                }&lt;BR /&gt;
            }&lt;BR /&gt;
        }&lt;BR /&gt;
    }&lt;BR /&gt;
&lt;NETCAI&gt; wrote in message news:4889347@discussion.autodesk.com...&lt;BR /&gt;
no body help me?&lt;/NETCAI&gt;</description>
      <pubDate>Thu, 30 Jun 2005 21:33:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364519#M84521</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-30T21:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: strange problem of double click event</title>
      <link>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364520#M84522</link>
      <description>Albert, thanks very much.&lt;BR /&gt;
your code works well, but I don't understanding why my code doesn't work. Our code's difference is : I use a static method,you use a instance method.</description>
      <pubDate>Fri, 01 Jul 2005 01:14:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364520#M84522</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-01T01:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: strange problem of double click event</title>
      <link>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364521#M84523</link>
      <description>one more question:&lt;BR /&gt;
after I run my double click event, the dited object  is highlighted, my question is how to make it unhighlighted,otherwise  I must press twice esc key.</description>
      <pubDate>Fri, 01 Jul 2005 03:01:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364521#M84523</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-01T03:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: strange problem of double click event</title>
      <link>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364522#M84524</link>
      <description>Albert, when I run your code, it works fine ,but when autocad exit, a error messagebox appeare, it shows "Unhandled Exception E0434F4D(e0434f4dh)" at address 7C81EB33h</description>
      <pubDate>Fri, 01 Jul 2005 04:32:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364522#M84524</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-01T04:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: strange problem of double click event</title>
      <link>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364523#M84525</link>
      <description>Did you run unhooked the even before exiting (by running the command again)?&lt;BR /&gt;
&lt;BR /&gt;
Albert&lt;BR /&gt;
&lt;NETCAI&gt; wrote in message news:4890685@discussion.autodesk.com...&lt;BR /&gt;
Albert, when I run your code, it works fine ,but when autocad exit, a error &lt;BR /&gt;
messagebox appeare, it shows "Unhandled Exception E0434F4D(e0434f4dh)" at &lt;BR /&gt;
address 7C81EB33h&lt;/NETCAI&gt;</description>
      <pubDate>Fri, 01 Jul 2005 15:44:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364523#M84525</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-01T15:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: strange problem of double click event</title>
      <link>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364524#M84526</link>
      <description>Frankly, if you want to replace the mtext editor then I wouldn't approach &lt;BR /&gt;
the problem this way: why don't you redefine the mtedit command like this?&lt;BR /&gt;
[CommandMethod("mtedit")]&lt;BR /&gt;
&lt;BR /&gt;
public void DoIt2()&lt;BR /&gt;
&lt;BR /&gt;
{&lt;BR /&gt;
&lt;BR /&gt;
AcadApp.DocumentManager.MdiActiveDocument.Editor.WriteMessage("My mtedit &lt;BR /&gt;
command.");&lt;BR /&gt;
&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
It would be much simpler and more reliable.&lt;BR /&gt;
&lt;BR /&gt;
Albert&lt;BR /&gt;
&lt;BR /&gt;
&lt;NETCAI&gt; wrote in message news:4890663@discussion.autodesk.com...&lt;BR /&gt;
one more question:&lt;BR /&gt;
after I run my double click event, the dited object  is highlighted, my &lt;BR /&gt;
question is how to make it unhighlighted,otherwise  I must press twice esc &lt;BR /&gt;
key.&lt;/NETCAI&gt;</description>
      <pubDate>Fri, 01 Jul 2005 15:49:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364524#M84526</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-01T15:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: strange problem of double click event</title>
      <link>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364525#M84527</link>
      <description>1. If I redefine mtedit command , I can't get the object on pickpoint use SelectImplied() method.  and more I can't redefine ddedit command, my aids is to hanle all the objects double click event.&lt;BR /&gt;
2. yes, I run the command again, but the error still exit.</description>
      <pubDate>Sat, 02 Jul 2005 01:18:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364525#M84527</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-02T01:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: strange problem of double click event</title>
      <link>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364526#M84528</link>
      <description>1. You have to specify CommandFlags.UsePickSet like in:&lt;BR /&gt;
[CommandFlags("mtedit", CommandFlags.Modal | CommandFlags.UsePickSet]&lt;BR /&gt;
Why can't you redefine the ddedit command? You must undefine it first &lt;BR /&gt;
because it is a built in command but you should be able to supply your own.&lt;BR /&gt;
&lt;BR /&gt;
2. I can't reproduce this. I'm not sure what else you have going on in your &lt;BR /&gt;
environment.&lt;BR /&gt;
&lt;BR /&gt;
Albert&lt;BR /&gt;
&lt;BR /&gt;
&lt;NETCAI&gt; wrote in message news:4891655@discussion.autodesk.com...&lt;BR /&gt;
1. If I redefine mtedit command , I can't get the object on pickpoint use &lt;BR /&gt;
SelectImplied() method.  and more I can't redefine ddedit command, my aids &lt;BR /&gt;
is to hanle all the objects double click event.&lt;BR /&gt;
2. yes, I run the command again, but the error still exit.&lt;/NETCAI&gt;</description>
      <pubDate>Sat, 02 Jul 2005 04:45:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364526#M84528</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-02T04:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: strange problem of double click event</title>
      <link>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364527#M84529</link>
      <description>Maybe I don't state clearly, I means I can't change autocad default double click command (ddedit,eattedit,refedit..) )with my command, because &lt;BR /&gt;
1. autocad alway use .ddedit to response double click event, so my ddedit doesn't work.&lt;BR /&gt;
2. I can redefine eattedit and refedit, I also use CommandFlags.UsePickSet flag as you say , but again SelectImplied() get nothing object.</description>
      <pubDate>Sat, 02 Jul 2005 12:55:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364527#M84529</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-02T12:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: strange problem of double click event</title>
      <link>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364528#M84530</link>
      <description>I think the best way to realize custom double click command is to use double click event , but as I say befor, the problem is after finish my own command , the object edited is still highlighted and selected , and  I must press "esc" key twice to continue my next work.</description>
      <pubDate>Sat, 02 Jul 2005 13:02:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364528#M84530</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-02T13:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: strange problem of double click event</title>
      <link>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364529#M84531</link>
      <description>To use the current selection set in a command, you need&lt;BR /&gt;
to include CommandFlags.UsePickSet in your command&lt;BR /&gt;
handler's CommandMethod attribute:&lt;BR /&gt;
&lt;BR /&gt;
[CommandMethod("YOURCOMMAND", CommandFlags.UsePickSet)]&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;NETCAI&gt; wrote in message news:4891655@discussion.autodesk.com...&lt;BR /&gt;
1. If I redefine mtedit command , I can't get the object on pickpoint use SelectImplied() method.  and more I can't redefine ddedit &lt;BR /&gt;
command, my aids is to hanle all the objects double click event.&lt;BR /&gt;
2. yes, I run the command again, but the error still exit.&lt;/NETCAI&gt;</description>
      <pubDate>Sat, 02 Jul 2005 17:39:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364529#M84531</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-02T17:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: strange problem of double click event</title>
      <link>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364530#M84532</link>
      <description>tony , I can redefine eattedit and refedit, I also use CommandFlags.UsePickSet flag as you say , but  SelectImplied() get nothing object.</description>
      <pubDate>Sun, 03 Jul 2005 00:41:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364530#M84532</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-03T00:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: strange problem of double click event</title>
      <link>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364531#M84533</link>
      <description>I'm not sure what you are doing. This seems to work fine for me.&lt;BR /&gt;
&lt;BR /&gt;
Albert&lt;BR /&gt;
&lt;BR /&gt;
&lt;NETCAI&gt; wrote in message news:4891851@discussion.autodesk.com...&lt;BR /&gt;
tony , I can redefine eattedit and refedit, I also use &lt;BR /&gt;
CommandFlags.UsePickSet flag as you say , but  SelectImplied() get nothing &lt;BR /&gt;
object.&lt;/NETCAI&gt;</description>
      <pubDate>Thu, 07 Jul 2005 21:39:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364531#M84533</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-07T21:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: strange problem of double click event</title>
      <link>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364532#M84534</link>
      <description>thanks, Albert. you are really a good man, with your help , I learn many useful things. &lt;BR /&gt;
I have solved my problem of double click event. through calling a command(my own unhighlight method ) with SendStringToExecute method after my own double click event, I can unhighlight the object edited sucessfully.&lt;BR /&gt;
&lt;BR /&gt;
but as you suggest , I can call my own double click command through redefine all commands related to double click , I trid ,but only mtext works, others command doesn't work.&lt;BR /&gt;
&lt;BR /&gt;
when I undefine ddedit command in my lisp,autocad default  ddedit command doesn't work in autocad if I directly run ddedit in command line,  instead my own ddedit run , but when I double click a text, autocad will run its internal command .ddedit, not run ddedit,so my own ddedit command doesn't work in double click event through this method.&lt;BR /&gt;
&lt;BR /&gt;
I can redefine eattedit and refedit, I also use CommandFlags.UsePickSet flag as you say , but again SelectImplied() get nothing object. &lt;BR /&gt;
&lt;BR /&gt;
thanks again .</description>
      <pubDate>Fri, 08 Jul 2005 01:15:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/strange-problem-of-double-click-event/m-p/1364532#M84534</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-08T01:15:22Z</dc:date>
    </item>
  </channel>
</rss>

