VDF常见问题整理(六十三):如何在不显示命令行的情况下使用PostCommandExecute

VectorDraw Developer Framework


问:如何在不显示命令行的情况下使用PostCommandExecute/span>

答:您可以使用在此表单中不可见的vdCommandLine.dll的形式添加命令行控件(vdComamndLine1),以便用户无法使用它或查看它并使用CommandExecute事件并使用代码:

 public Form1()        {            InitializeComponent();        }        protected override void OnLoad(EventArgs e)        {            //   the form contains a VectorDRaw BaseControl named myVDBaseControl1            //   and a vdCommendLine control that is not visible named vdCommandLine1            base.OnLoad(e);            doc = myVDBaseControl1.ActiveDocument;            vdCommandLine1.SelectDocument(doc);            vdCommandLine1.CommandExecute += VdCommandLine1_CommandExecute;        }        private void VdCommandLine1_CommandExecute(string commandname, bool isDefaultImplemented, ref bool success)        {            if (string.Compare(commandname , "zoomw", true) == 0)            {                success = true;                doc.CommandAction.Zoom("W", null, null);                return;            }            }        private void toolStripButton1_Click(object sender, EventArgs e)        {            vdCommandLine1.PostExecuteCommand("zoomw");

=======================================================

如果您对想要购买正版授权VectorDraw Developer Framework(VDF),可以联系在线客服>>咨询相关问题。

标签:

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2020年11月26日
下一篇 2020年11月26日

相关推荐

发表回复

登录后才能评论