几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   ObjectARX(VB.NET/C#) (http://www.dimcax.com/hust/forumdisplay.php?f=176)
-   -   【转帖】vb.net tooltip 可能存在点小问题 (http://www.dimcax.com/hust/showthread.php?t=8992)

yang686526 2009-04-20 12:31 PM

【转帖】vb.net tooltip 可能存在点小问题
 
vb.net tooltip 可能存在点小问题
www.dimcax.com
vb.net tooltip 可能存在点小问题
option strict on
imports autodesk.autocad.applicationservices
imports autodesk.autocad.databaseservices
imports autodesk.autocad.editorinput
imports autodesk.autocad.runtime
namespace 动态取得对象
public class class1
dim db as database = hostapplicationservices.workingdatabase
dim ed as editor = application.documentmanager.mdiactivedocument.editor
dim entname as string '对象名称
<commandmethod("test")> _
public sub test()
addhandler ed.rollover, addressof getentityfrommouse
addhandler ed.pointfilter, addressof settooltip
end sub
'设置tooltip
private sub settooltip(byval sender as object, byval e as pointfiltereventargs)
if entname = nothing then
e.result.tooltiptext = entname
else
e.result.tooltiptext = "当前对象是:" + entname
end if
end sub
'通过鼠标动态获取对象
private sub getentityfrommouse(byval sender as object, byval e as rollovereventargs)
entname = nothing
dim entids() as objectid = e.highlighted.getobjectids()
if entids.getlength(0) > 0 then
using trans as transaction = db.transactionmanager.starttransaction()
dim ent as entity = ctype(trans.getobject(entids(0), openmode.forread, false), entity) '.getxdata(appname)
entname = ent.getrxclass.name
ed.writemessage(vblf + "当前对象是:" + entname + vblf)
trans.commit()
end using
end if
end sub
end class
end namespace
问题呢?
c#最适合开发autocad,因为它拥有vb容易的特点,却具有vc++的强大功能。
鼠标首次移动到对象,有时显示系统tooltip。


所有的时间均为北京时间。 现在的时间是 02:07 AM.