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