当鼠标置于Visio图的Shape上时,需要将当前DetailInfo显示出来。
以下程序实现当鼠标置于Shape上时间超过2s时,弹出DetailInfo的窗口。
1.在鼠标的MouseMove事件响应函数中添加
Shape moveShape = null;
Shape lastShape = null;
ShapeItem item = new ShapeItem();
private void Application_MouseMove(int Button, int KeyButtonState, double x, double y, ref bool CancelDefault)
{
if (!isMouseMiddle && buttonKey != 1)
{
//确定弹出窗体的position
showPoint = Control.MousePosition;// new Point((int)x, (int)y);
showPoint.X -= 100;
if (showPoint.X < 10)
{
showPoint.X = 10;
}
else if (showPoint.X > this.Width - 10)
{
s