怎样实现鼠标悬停时显示Xdata中的内容
我在对象(如直线)中已附加了Xdata数据,在鼠标悬停在该直线上时,想自动弹出个窗体来显示Xdata数据,请问该怎样实现,谢谢大家。 Mark,回头看看,有没有编程实现设置【系统的悬停提示关闭了
在选项的显示选项卡里面可以关闭】的? 一会传你一个 声明版权归不死猫所有 感谢回复。
抱歉,我的明币不足,请问有VB.net的示例代码吗?期待中………… 用pointmonitor,官方教程有 sailorcwx 发表于 2012-5-9 12:30 static/image/common/back.gif
用pointmonitor,官方教程有
能具体说明吗?找了下没找到
多谢回复
示例代码严重期待中 已OK了
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.GeomeTry
Imports Autodesk.AutoCAD.Runtime
Namespace tooltip
Public Class Class1
Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
<CommandMethod("TestOn")> _
Public Sub MyTestOn()
AddHandler ed.PointMonitor, New PointMonitorEventHandler(AddressOf ed_PointMonitor)
End Sub
<CommandMethod("TestOff")> _
Public Sub MyTestOff()
RemoveHandler ed.PointMonitor, New PointMonitorEventHandler(AddressOf ed_PointMonitor)
End Sub
Private Sub ed_PointMonitor(ByVal sender As Object, ByVal e As PointMonitorEventArgs)
Dim db As Database = HostApplicationServices.WorkingDatabase
Dim ipc As InputPointContext = e.Context
Dim ePaths() As FullSubentityPath = ipc.GetPickedEntities()
If ePaths.Length > 0 Then
Dim ePath As FullSubentityPath = ePaths(0)
Dim trans As Transaction = db.TransactionManager.StartTransaction()
Dim entId As ObjectId = ePath.GetObjectIds()(0)
Dim ent As Entity = CType(trans.GetObject(entId, OpenMode.ForRead), Entity)
e.AppendToolTipText(vbCrLf & "这是 :" + ent.GetType().FullName)
trans.Commit()
End If
End Sub
End Class
End Namespace 上面的代码,我在2007中试没问题,但在2010中却显示不出来。好像
“e.AppendToolTipText(vbCrLf & "这是 :" + ent.GetType().FullName)”
这句没有发生作用,是有什么设置,还是代码有问题,请楼上赐教。多谢 这是因为系统的悬停提示覆盖了你的悬停提示,你可以把系统的悬停提示关闭了
在选项的显示选项卡里面可以关闭
页:
[1]
2