Winforms:使用信息文本等待光标

时间:2012-05-16 09:17:46

标签: c# .net winforms cursor

是否有可能在等待光标旁边显示一个小的信息文本。这是一个很好的功能,可以在用户等待期间向用户提供一些活动信息。

2 个答案:

答案 0 :(得分:2)

是。您必须在鼠标位置旁边使用标签。只需尝试以下代码:

private void pictureBox1_MouseEnter(object sender, EventArgs e)
        {
            pictureBox1.Cursor = Cursors.WaitCursor;
            Label lb = new Label();
            lb.Location = new Point(MousePosition.X-this.Left,MousePosition.Y-this.Top);
            lb.Text = "Your Info";
            this.Controls.Add(lb);

        }

答案 1 :(得分:1)

我建议使用自定义光标。 C# Tutorial - How To Use Custom Cursors