2017-03-08 40 views
0

點擊一個按鈕,將投影waitcursor如何使定製光標當你點擊一個按鈕

enter image description here

,當你將鼠標懸停,例如在後退按鈕就像當我怎樣才能定製,這將是默認光標或手的事情,當我點擊它會顯示如下

enter image description here

預先感謝您

回答

0

我設法回答我的問題

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; 
     } 

    } 
0
private void pictureBox1_MouseUp(object sender, EventArgs e) 
{ 
    pictureBox1.Cursor = Cursors.WaitCursor; 
}