zoukankan      html  css  js  c++  java
  • CAD中点击form上的按钮在屏幕中选择点或者其它GetXXX操作并同时Close Form的方法(getpoint close form)

    using System.Windows.Forms;

    namespace AutoCadWinFormDialogSample
    {
        public partial class SingleButtonDialog : Form
        {
            public SingleButtonDialog()
            {
                InitializeComponent();
                button1.DialogResult = DialogResult.OK;
            }

      //将原来本应该是按钮的事件做成一个公有方法

         public void BtnOK_Click()
         {

      }
        }
    }

    using Autodesk.AutoCAD.EditorInput;
    using Autodesk.AutoCAD.Runtime;
    using System.Windows.Forms;
    using AcAp = Autodesk.AutoCAD.ApplicationServices.Application;

    namespace AutoCadWinFormDialogSample
    {
        public class Commands
        {
            [CommandMethod("Test")]
            public void Test()
            {
                var dlg = new SingleButtonDialog();
                var result = AcAp.ShowModalDialog(dlg);
                if (result == DialogResult.OK)
                {
                    dlg.BtnOK_Click();
                }
            }
        }
    }

  • 相关阅读:
    正则表达式
    爬虫原理和网页构造
    简单的博客系统之二
    配置编辑器geany
    linux删除多文件
    eNSP交换路由基础
    NTP centOS6.5
    shell脚本之lftp上传
    进度条
    maketrans与translate函数
  • 原文地址:https://www.cnblogs.com/swtool/p/8318526.html
Copyright © 2011-2022 走看看