Show hourglass cursor 
Author Message
 Show hourglass cursor

When I do Form.Show it sometimes takes awhile. How can I put up an
hourglass mouse cursor while the form is loading?


Sat, 09 Jun 2001 03:00:00 GMT  
 Show hourglass cursor
You could Change the cursor right before calling the target form and then
change the cursor back to default on the target form's OnActivate event.
Quote:

>When I do Form.Show it sometimes takes awhile. How can I put up an
>hourglass mouse cursor while the form is loading?



Sat, 09 Jun 2001 03:00:00 GMT  
 Show hourglass cursor
Check your VB help for Screen.mousepointer. vbHourGlass can be specified.
Place
it at the start of your routine and switch it back to default at the end.



Quote:
> When I do Form.Show it sometimes takes awhile. How can I put up an
> hourglass mouse cursor while the form is loading?



Sat, 09 Jun 2001 03:00:00 GMT  
 Show hourglass cursor
Try this:

    Mousepointer = vbHourGlass

and to come back

    Mousepointer = vbDefault

HTH,

Marcelo Nogueira Magri
Morbid Software Corporation

+55-11-9261-8989


Quote:
>When I do Form.Show it sometimes takes awhile. How can I put up an
>hourglass mouse cursor while the form is loading?



Sat, 09 Jun 2001 03:00:00 GMT  
 Show hourglass cursor
And if the stuff you are running is processor intensive, you might need
to follow the mouspointer statement with a DoEvents in order for the
cursor to show up before the operation completes.

Charles

Quote:

> When I do Form.Show it sometimes takes awhile. How can I put up an
> hourglass mouse cursor while the form is loading?



Sat, 09 Jun 2001 03:00:00 GMT  
 Show hourglass cursor
Use the Screen.MousePointer = vbHourGlass call when you want to enable the
hourglass pointer and reset it using the vbDefault constant.

later....john



Sun, 10 Jun 2001 03:00:00 GMT  
 Show hourglass cursor
Hummmmm......

Try this....

    Screen.Mousepointer = vbHourglass
    Form1.Show
    Screen.MousePointer = vbDefault



Sun, 10 Jun 2001 03:00:00 GMT  
 Show hourglass cursor
In VB5/6 I make a function in a module...

Public Sub FormShow(InForm as Form)
   Screen.MousePointer = vbHourglass
   InForm.Show
   If InForm.WindowState = vbMinimized Then
      InForm.WindowState = vbNormal
   End If
   InForm.SetFocus
   Screen.MousePointer = vbDefault
End Sub

To use:

Private Sub mnuShowFrmCad_Click()
    FormShow FrmCad
End Sub



Sun, 10 Jun 2001 03:00:00 GMT  
 Show hourglass cursor


Quote:
>When I do Form.Show it sometimes takes awhile. How can I put up an
>hourglass mouse cursor while the form is loading?

I prefer to create a simple class module as follows

---------------------------------------------------
Class clsSafeMousePointer

Option Explicit

Private Type SafeMousePointerProperties
    blnInitialised as Boolean
    lngDefaultPointer as Long
    objForm As Object
End Type
Private mudtProps As SafeMousePointerProperties

Private Sub Class_Initialize()
    mudtProps.blnInitialised = False
End Sub

Private Sub Class_Terminate()
    With mudtProps
        If .blnInitialised Then
            objForm.MousePointer = lngDefaultMousePointer
        End If
    End With    
End Sub

Public Sub Initialise(objForm As Object, _
                      ByVal lngPointer As MousePointerConstants)

    If TypeOf objForm Is Form Then
        With mudtProps
            .blnInitialised = True
            .lngDefaultMousePointer = objForm.MousePointer
            .objForm = objForm
            objForm.MousePointer = lngPointer
            DoEvents
        End With
    End If

End Sub
---------------------------------------------------

This can then be used in the code as

Dim objMP as New clsSafeMousePointer
objMP.Initialise Me, vbHourGlass

..
..
..

Set objMP = Nothing

For me the beauty of this is that if you forget to reset the mouse
pointer by setting the object to Nothing, the fact that it goes out of
scope destroys the object and restores the mouse pointer to whatever
it was before. All other replies assumed that it was the default.

I apologise if there are any errors in the above code but I've just
entered it off the top of my head from memory of what I've implemented
successfully at work.

Software Consultant
Lockdesign Ltd
UK
Web Page Currently Under Construction [www.lockdes.demon.co.uk]



Sun, 10 Jun 2001 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Cursor doesn't change to Hourglass

2. Hourglass cursor in standard outlook folder view (inbox) ?

3. Hourglass cursor in standard folder view (Inbox) ?

4. Change the cursor icon to hourglass?

5. Hourglass cursor in standard folder view (inbox) ?

6. How to set Hourglass cursor?

7. Hourglass Cursor

8. Hourglass mouse cursor

9. How to force VB to make cursor=hourglass during startup

10. change cursor to hourglass?

11. Hourglass Cursor w/VB4

12. Help Needed: Timer and the hourglass cursor

 

 
Powered by phpBB® Forum Software