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. General Programming
  3. C#
  4. Wait Cursor with Timer?

Wait Cursor with Timer?

Scheduled Pinned Locked Moved C#
questioncsharpdata-structureshelp
2 Posts 2 Posters 0 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.
  • R Offline
    R Offline
    redfish34
    wrote on last edited by
    #1

    For a treeview i would like to change the mouse cursor to an hour glass after a delay when selected tree nodes take a long time to populate. I was able to do this in VB6 using a timer event, where a busy flag is set and then the timer event checks flag to determine if cursor should be changed to an hour glass. When i try to do similar in C# the cursor does not change. I am able to change the cursor in the code populating the node, but that causes flickering becasue the hourglass is shown even when selected nodes do not take long to populate. Am i dealing with some kind of multi thread issue here? What is the normal solution?

    G 1 Reply Last reply
    0
    • R redfish34

      For a treeview i would like to change the mouse cursor to an hour glass after a delay when selected tree nodes take a long time to populate. I was able to do this in VB6 using a timer event, where a busy flag is set and then the timer event checks flag to determine if cursor should be changed to an hour glass. When i try to do similar in C# the cursor does not change. I am able to change the cursor in the code populating the node, but that causes flickering becasue the hourglass is shown even when selected nodes do not take long to populate. Am i dealing with some kind of multi thread issue here? What is the normal solution?

      G Offline
      G Offline
      Gavin Roberts
      wrote on last edited by
      #2

      when your about to do your complex and time costing code, simply add this.Cursor = Cursor.Busy; // your code this.Cursor = Cursor.Default;

      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