鼠标移动到实体上后,停留一会,控件可能得到该实体对象,然后能动态提示一些信息。响应控件事件:DMxDrawXEvents::InputPointToolTipEvent,详细说明参考:http://www.mxdraw.com/help/MxDrawXLib___DMxDrawXEvents__InputPointToolTipEvent@IDispatch_@BSTR_.htm,调用函数SetDynToolTipPopTime设置动态提示时间。
1. 增加InputPointToolTipEvent事件响应函数:
document.getElementById("MxDrawXCtrl").ImpInputPointToolTipFun = DoInputPointToolTipFun;
2. 在事件中返回需要提示的字符串,在事件代码里,把对象类型名提示出来:
function DoInputPointToolTipFun(ent) { { var sClassName = ent.ObjectName; var tip = "<b><ct=0x0000FF><al_c>"+sClassName+ "</b><br><ct=0x00AA00><hr=100%></ct><br>"; mxOcx.SetEventRetString(tip); } ent = null; CollectGarbage(); }
动态提示效果如下:

来源:https://www.cnblogs.com/yzy0224/p/12016771.html