【发布时间】:2013-02-28 17:41:32
【问题描述】:
我有一个登录表单。该表单有 2 个文本框和 3 个按钮。一个按钮显示“学生”。
我想要做的是在表单打开时在此按钮上显示一个工具提示。我不想必须转到按钮并将鼠标悬停在其上才能显示。我希望表单加载,显示工具提示,然后工具提示应在 5 秒后消失。这是我迄今为止尝试过的:
private void Form1_Load(object sender, EventArgs e)
{
toolTip.IsBalloon = true;
toolTip.ToolTipIcon = ToolTipIcon.Info;
toolTip.ShowAlways = true;
toolTip.UseFading = true;
toolTip.UseAnimation = true;
toolTip.ToolTipTitle = "Student Mode";
toolTip.Show("You don't have to log in if you are a student. Just click here to go to the questions.", btnStudent);
}
【问题讨论】:
-
您可以在表单加载时启动计时器。将计时器滴答设置为 5000,在第一个滴答事件中停止计时器并将您的工具提示设置为正常的工具提示。