0

How can i customize when clicking a button that will project a waitcursor

enter image description here

like when you hover your mouse, for example in the back button , it will be default cursor or the hand thing and when i click it will display like this

enter image description here

thank you in advance

Pudge
  • 47
  • 1
  • 9

2 Answers2

0
private void pictureBox1_MouseUp(object sender, EventArgs e)
{
    pictureBox1.Cursor = Cursors.WaitCursor;
}
Koby Douek
  • 16,156
  • 19
  • 74
  • 103
0

i manage to answer my question

private void btnLOGIN_Click(object sender, EventArgs e)
    { 
        try
        {

            Cursor.Current = Cursors.WaitCursor;
            Application.DoEvents();
            System.Threading.Thread.Sleep(500);//set time to load

            if (txtUser.Text == "admin" && txtPass.Text == "")
            {
                this.Hide();
                MENU ss = new MENU();
                MessageBox.Show("Welcome to CornerFlag's Product Monitoring System!", "Login Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
                ss.Show();
            }
            else
            {
                MessageBox.Show("Invalid Input , Try Again ", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtUser.Clear();
                txtPass.Clear();
            };

        }
        finally
        {
            Cursor.Current = Cursors.Default;
        }

    }
Pudge
  • 47
  • 1
  • 9