110,545
社区成员
发帖
与我相关
我的任务
分享
// List<RectangleF> lr ……Picture MoseMove 事件中
for (int i = 0; i < lr.Count; i++)
{
if (lr[i].Contains(e.Location))
{
//toolTip.IsBalloon = true;
//toolTip.ToolTipIcon = ToolTipIcon.Info;
toolTip.ForeColor = Color.Red;
//toolTip.ToolTipTitle = "详细信息";
toolTip.Show("【标准工时】: " + dic[i].RefDuration + "秒\n【平均工时】: " + dic[i].Practicetime / dic[i].Finishcount + "秒\n【日期】: " + Convert.ToDateTime(dic[i].BrushDate).ToShortDateString(), pic, e.X - pic.Location.X + 10, e.Y - pic.Location.Y + 10, 10000);
this.labMemo.Text = "【工号】:" + empcode + "\n【日期】:" + Convert.ToDateTime(dic[i].BrushDate).ToShortDateString() + "\n【个人达成率】:" + Math.Round(dic[i].RefDuration / (dic[i].Practicetime / dic[i].Finishcount), 2) * 100 + "%";
break; }
else
{
toolTip.Hide(pic);
}
}
break;
else
{
toolTip.Hide(pic);
}
protected override void OnMouseMove(MouseEventArgs e)
{
Rectangle rect = new Rectangle(20, 20, 100, 100);
if (rect.Contains(e.Location))
{
this.toolTip1.SetToolTip(this, "tooltip");
}
else
{
this.toolTip1.SetToolTip(this, null);
}
base.OnMouseMove(e);
}