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. Visual Basic
  4. Hourglass

Hourglass

Scheduled Pinned Locked Moved Visual Basic
question
5 Posts 4 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.
  • L Offline
    L Offline
    Liottru
    wrote on last edited by
    #1

    Hi guys, how can I set a hourglass during a process? Thanks

    K J D 3 Replies Last reply
    0
    • L Liottru

      Hi guys, how can I set a hourglass during a process? Thanks

      K Offline
      K Offline
      KaineDunno
      wrote on last edited by
      #2

      Somthing like this maybe? Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ' save the old cursor Cursor oldCursor = Me.Cursor; ' change the cursor to the one you want Me.Cursor = Cursors.WaitCursor ' do your work here ' restore the old cursor or else you may never get it back Me.Cursor = oldCursor End Sub

      1 Reply Last reply
      0
      • L Liottru

        Hi guys, how can I set a hourglass during a process? Thanks

        J Offline
        J Offline
        Johan Hakkesteegt
        wrote on last edited by
        #3

        Hi, There is actually no need to save the cursor to memory. Me.Cursor = CType(Cursors.WaitCursor, Cursor) 'Your process starts here 'Your process happens here 'Your process finishes here Me.Cursor = CType(Cursors.Default, Cursor) Have fun, Johan

        My advice is free, and you may get what you paid for.

        1 Reply Last reply
        0
        • L Liottru

          Hi guys, how can I set a hourglass during a process? Thanks

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          All you have to do is set the Cursor property.

          Me.Cursor = Cursors.WaitCursor
          ' You _might_ have to do this, depending on your code...
          Application.DoEvents()
          '
          ' Long running code goes here...
          '
          Me.Cursor = Cursors.Default
          

          Dave Kreskowiak Microsoft MVP - Visual Basic

          L 1 Reply Last reply
          0
          • D Dave Kreskowiak

            All you have to do is set the Cursor property.

            Me.Cursor = Cursors.WaitCursor
            ' You _might_ have to do this, depending on your code...
            Application.DoEvents()
            '
            ' Long running code goes here...
            '
            Me.Cursor = Cursors.Default
            

            Dave Kreskowiak Microsoft MVP - Visual Basic

            L Offline
            L Offline
            Liottru
            wrote on last edited by
            #5

            Thank you very much guys!

            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