qianzj 发表于 2013-4-26 13:38:55

dcl_Control_SetEventInvoke

(defun c:dict_Form1_TextButton1_OnClicked (/)
(dcl_Control_SetEventInvoke <CONTROL> 1)
(setq pt (getpoint "\n指定点:"))
(command "_text" pt "350" "" text)
)
想在这里调用commandr的命令但是(dcl_Control_SetEventInvoke <CONTROL> 1)显示Error ?求帮助

Gu_xl 发表于 2013-4-26 14:36:50

<CONTROL> 是神马东西?是控件名称么?
如果要修改dict_Form1_TextButton1的tEventInvoke属性,修改的属性对本次命令无效!下次使用才有效!
所以你这种方法是不正确的,应该在设计对话框时或在Form1_OnInitialize事件中修改dict_Form1_TextButton1的tEventInvoke属性!

qianzj 发表于 2013-4-26 14:53:43

(defun C:tt()
(dcl_Project_Load "dict" T)
(dcl_Form_Show dict_Form1)
(princ)
)
(defun c:词库_Form1_OnInitialize (/)
(dcl_Control_SetCaption dict_Form1_TextButton1 "W De110")
(dcl_Control_SetEventInvoke <dict_Form1> "1")
(setq text (dcl_Control_GetCaption dict_Form1_TextButton1))
)


(defun c:dict_Form1_TextButton1_OnClicked (/)
(setq pt (getpoint "\n指定点:"))
(command "_text" pt "350" "" text)
)

qianzj 发表于 2013-4-26 14:54:16

Gu_xl 发表于 2013-4-26 14:36 static/image/common/back.gif
是神马东西?是控件名称么?
如果要修改dict_Form1_TextButton1的tEventInvoke属性,修改的属性对本次命令 ...

还是不行。。

qianzj 发表于 2013-4-26 15:03:15

调试成功!原来 <CONTROL>是控件的名称!
(dcl_Control_SetEventInvoke dict_Form1_TextButton1 1)
页: [1]
查看完整版本: dcl_Control_SetEventInvoke