Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Change the Cursor

Change the Cursor

Scheduled Pinned Locked Moved Web Development
csharpasp-nethelp
4 Posts 3 Posters 6 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    skannapiran
    wrote on last edited by
    #1

    Hi All, In web based application, ASP.Net + C#. I want to do like this protected void Function() { this.cursor = Cursor. Wait; /// do some operations this.cursor = Cursor.deafult; } The above code will work for Window based application, but i want to implement it in Web Based. Anybody please help me... Kannapiran S

    G B 2 Replies Last reply
    0
    • S skannapiran

      Hi All, In web based application, ASP.Net + C#. I want to do like this protected void Function() { this.cursor = Cursor. Wait; /// do some operations this.cursor = Cursor.deafult; } The above code will work for Window based application, but i want to implement it in Web Based. Anybody please help me... Kannapiran S

      G Offline
      G Offline
      g00fyman
      wrote on last edited by
      #2

      you need to use javascript *something* like this

      function LongTask(obj)
      {
      obj.style.cursor = "HourGlass";

      /* logic in here */

      obj.style.cursor = "Default";
      }

      g00fy

      S 1 Reply Last reply
      0
      • G g00fyman

        you need to use javascript *something* like this

        function LongTask(obj)
        {
        obj.style.cursor = "HourGlass";

        /* logic in here */

        obj.style.cursor = "Default";
        }

        g00fy

        S Offline
        S Offline
        skannapiran
        wrote on last edited by
        #3

        protected void cmdBtn_Click(object sender, EventArgs e) { WaitCursor(); //... some operations .... DefaultCursor(); } protected void WaitCursor() { // JavaScript function for Wait Cursor. string strWaitCursor = "" + "document.body.style.cursor = 'wait';" + ""; // Add the JavaScript code to the page. ClientScript.RegisterStartupScript(this.GetType(), "WaitCursor", strWaitCursor); } protected void DefaultCursor() { // JavaScript function for Default Cursor. string strDefaultCursor = "" + "document.body.style.cursor = 'default';" + ""; // Add the JavaScript code to the page. ClientScript.RegisterStartupScript(this.GetType(), "DefaultCursor", strDefaultCursor); } Will it work???? Kannapiran S

        1 Reply Last reply
        0
        • S skannapiran

          Hi All, In web based application, ASP.Net + C#. I want to do like this protected void Function() { this.cursor = Cursor. Wait; /// do some operations this.cursor = Cursor.deafult; } The above code will work for Window based application, but i want to implement it in Web Based. Anybody please help me... Kannapiran S

          B Offline
          B Offline
          Bradml
          wrote on last edited by
          #4

          Doesn't CSS have a cursor function? Infact i know it does: cursor: auto (uses what is set by user) cursor: crosshair (should produce a cross) cursor: default (cursor remains as it is) cursor: e-resize (arrow pointing right) cursor: hand (the traditional pointing hand) cursor: help (a Question Mark should appear) cursor: move (a cross with arrows on the tips) cursor: n-resize (an arrow pointing north or up) cursor: ne-resize (an arrow pointing northeast) cursor: nw-resize (an arrow pointing northwest) cursor: pointer (that hand again) cursor: s-resize (an arrow pointing south or down) cursor: se-resize (an arrow pointing southeast) cursor: sw-resize (an arrow pointing southwest) cursor: text (looks like the end of an I-beam) cursor: w-resize (an arrow pointing west) cursor: wait (an hourglass) There you go. Use Javascript to change the style of the elemnet that the user's mouse is in. I would suggest a

          that surrounds the whole page and allows you to change the cursor without affecting the other CSS rules you have inplace!

          Brad Australian Have you tried Rebooting it?

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups