Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Managing the Hourglass
Message
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Titre:
Managing the Hourglass
Divers
Thread ID:
00481819
Message ID:
00481819
Vues:
57
[Snipped directly from VB Zone] Full credit should be given to Charles Gaddy
Raleigh, North Carolina rather than the author of this post. :) But I thought it was done well, and actually usefull.

Managing the Hourglass

It can be very useful to have a central public function for manipulating the mouse pointer in a Visual Basic application. This function can help you organize how the hourglass is shown and at what level (form, screen):
Public Sub Hourglass(ByVal blnHourglassSetTo As Boolean)

Select Case Forms.Count

Case 0 'No Form is loaded so set the screen
    If blnHourglassSetTo = True Then
        Screen.MousePointer = vbHourglass
    Else
        Screen.MousePointer = vbDefault
    End If

Case Else

    If blnHourglassSetTo = True Then
        If VB.Screen.ActiveForm Is Nothing Then
            Screen.MousePointer = vbHourglass
        Else
            VB.Screen.ActiveForm.MousePointer = vbHourglass
        End If

    Else
        If Not VB.Screen.ActiveForm Is Nothing Then
            Screen.MousePointer = vbDefault
            VB.Screen.ActiveForm.MousePointer = vbDefault
        End If

        Screen.MousePointer = vbDefault

    End If

End Select

End Sub
~Joe Johnston USA

"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams

Répondre
Fil
Voir

Click here to load this message in the networking platform