主要用到函数说明:
MxDrawXCustomFunction::Mx_RegistUserCustomCommand
向控件注册一个命令,用户在命令行输入命令名这个字符串,就会触发执行命令事件 命令事件的id就是该注册时的id值,详细说明如下:
参数 | 说明 |
---|---|
CString sCommandName |
命令名称 |
LONG lId |
命令id |
VB代码实现如下:
1
2
3
4
5
6
|
Set param2 = New MxDrawXLib.MxDrawResbuf
param2.AddString
"testcommand"
, -10
param2.AddLong 55, -10
MxDrawX1.CallEx
"Mx_RegistUserCustomCommand"
, param2
'或者
MxDrawX1.Call
"Mx_RegistUserCustomCommand"
,
"("
"testcommand"
",55)"
|