C# FormTool.SetCursor设置光标为等待状态,提高用户体验-C/S开发框架
C# FormTool.SetCursor设置光标为等待状态,提高用户体验
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CSFrameworkV5.Library.CommonClass
{
public class FormTool
{
public static void SetCursor(Control btn, bool enable)
{
if (btn != null) btn.Enabled = enable;
if (enable)
Cursor.Current = Cursors.Default;
else
Cursor.Current = Cursors.WaitCursor;
Application.DoEvents();
}
}
}