|
www.mxdraw.com
|
向控件注册一个命令,用户在命令行输入命令名这个字符串,就会触发执行命令事件 命令事件的id就是该注册时的id值。
[id(163), helpstring("method RegistUserCustomCommand")]
VARIANT_BOOL RegistUserCustomCommand(BSTR pszCommandName, LONG lId);|
参数 |
说明 |
|
BSTR pszCommandName |
命令名称 |
|
LONG lId |
命令id. |
成功返回true;
例如: VB调用代码
MxDrawX1.RegistUserCustomCommand "testcommand", 55
例如: C#调用代码
axMxDrawX1.RegistUserCustomCommand("MyTest11",9999);
axMxDrawX1.Focus();
// 命令 响应代码
private void axMxDrawX1_ImplementCommandEvent(object sender, AxMxDrawXLib._DMxDrawXEvents_ImplementCommandEventEvent e)
{
if (e.iCommandId == 9999)
{
MessageBox.Show("用户定义命令执行....");
}
}