cadplayer 发表于 2015-10-5 02:32:38

隐藏()消息,当按转义(错误消息)

你好
我想捕捉一个转义事件,以防我按下“选择”按钮,winform隐藏,我可以选择某人。但如果我在按下escape键时没有选择,我会收到一条错误消息
我尝试捕捉Formclosing事件,它可以工作,但首先我收到Autocad错误消息,然后它会出现FormClosings消息。有人能更好地解决这个问题吗?
**** Hidden Message *****

cadplayer 发表于 2015-10-5 07:28:47


如果我在方法
中按下“Escape”,就会收到此消息try
            {
                PromptEntityOptions options = new PromptEntityOptions("\nSelect a Surface: ");
                options.AllowNone = false;
                options.SetRejectMessage("\nThe selected object is not a Surface.");
                options.AddAllowedClass(typeof(CivSurface), false);
               
                PromptEntityResult result = ed.GetEntity(options);
                if (result.Status == PromptStatus.OK)
                {
                  this.SurfaceId = result.ObjectId;
                }
                if (ObjectId.Null == SurfaceId)
                {
                  ed.WriteMessage("\nNo TIN Surface object was selected.");
                }
            }
            catch(Exception ex)
            {
                ed.WriteMessage("\nClose Program");
            }

MexicanCustard 发表于 2015-10-5 10:21:53

如果promptresult不是Ok,您在哪里分配SurfaceId?

cadplayer 发表于 2015-10-22 14:12:27

是的,很清楚——谢谢!
页: [1]
查看完整版本: 隐藏()消息,当按转义(错误消息)