Msg.Thermometer (property)


Msg.Thermometer [= percentage]


Changes the percentage filled indicated within the thermometer of a message dialog box (one that was previously opened with the Msg.Open method).


A runtime error will result if a message box is not currently open (using Msg.Open) or if the value of percentage is not between 0 and 100 inclusive.


This example create a modeless message box with a thermometer and a Cancel button. This example also shows how to process the clicking of the Cancel button.

Sub Main()

  On Error Goto ErrorTrap

  Msg.Open "Reading records from file...",0,True,True

  For i = 1 To 100  'Read a record here.

    'Update the modeless message box.

    Msg.Thermometer =i


    Sleep 50

  Next i


  On Error Goto 0   'Turn error trap off.

  Exit Sub


  If Err = 809 Then

    MsgBox "Cancel was pressed!"

    Exit Sub    'Reset error handler.

  End If

End Sub

See Also

Msg.Close (method); Msg.Open (method); Msg.Text (property).

More information