Application.UseWaitCursor有时会延迟

时间:2019-01-11 12:12:34

标签: c# winforms

我在一种方法中使用Application.UseWaitCursor:

    private void connectButton_Click(object sender, EventArgs e)
    {
        if (this.ValidateForm())
        {
            Application.UseWaitCursor = true;
            this.connectButton.Enabled = false;
            this.Connect();

            if (this.rememberMeCheckBox.Checked == true)
            {
                SaveCredential();
            }
            else
            {
                DeleteCredential();
            }

            Properties.Settings.Default.RememberMe = this.rememberMeCheckBox.Checked;
            Properties.Settings.Default.Save();
        }
        this.ActiveControl = this.statusLabel;
    }

...有时(可能是20次中的1次,似乎是随机的),等待光标在显示之前稍有延迟。大约1-2秒左右。

有什么理由会延迟吗?

感谢您帮助我们解决此问题。

0 个答案:

没有答案