Public · Protected · Private
Setting mouse cursor
Type: Public  |  Created: 2012-09-01  |  Frozen: Yes
« Previous Public Blog Next Public Blog »
Comments
  •  

    To set the cursor for your window

                this.Cursor = Cursors.Wait;Cursors.Wait;

    for a particular element

                button1.Crsor = Cursors.Wait;Cursors.Wait;

    To set for application in full

    Mouse.OverrideCursor = Cursors.Wait;
    // Mouse.OverrideCursor = null; // to revert the same
      

     

    To get the cursor from resources ... add a hammer.ani file and set compile option as "Resource"

     StreamResourceInfo sri = Application.GetResourceStream(

    new Uri("hammer.ani", UriKind.RelativeOrAbsolute));            
                this.Cursor = new Cursor(sri.Stream);

    2012-09-01 20:34
This blog is frozen. No new comments or edits allowed.