3
在运行时,我创建一个所有者绘制工具提示,在弹出事件中设置我的工具提示窗口的大小,并在绘制事件中设置文本。如何设置所有者绘制工具提示的位置?
public void NewLabel(string aText)
{
ToolTip tt = new ToolTip();
tt.Popup += new PopupEventHandler(tt_Popup);
tt.Draw += new DrawToolTipEventHandler(tt_Draw);
tt.BackColor = Color.White;
tt.AutomaticDelay = 100;
tt.AutoPopDelay = 35000;
tt.IsBalloon = false;
tt.OwnerDraw = true;
tt.SetToolTip(aLabel, sToolTip);
}
public void tt_Popup(object sender, PopupEventArgs e)
{
e.ToolTipSize = new Size(e.ToolTipSize.Width + 300, e.ToolTipSize.Height + 200);
}
public void tt_Draw(object sender, DrawToolTipEventArgs e)
{
e.DrawBackground();
e.DrawBorder();
}
这工作得很好,但问题是,如果我的工具提示抽奖活动是由控制在我的屏幕底部发射时,工具提示中不可视区域automaticaly像标准提示不设置。
有什么想法?
它是Frameworks 3.5上的WinForms应用程序 – Peter 2012-08-06 18:14:35