Refresh

<< Click to Display Table of Contents >>

 

Refresh

Refresh([Force])

The Refresh method allows forcing a redrawn of a Screen's or Splitter's content. It must be used in Elipse Power Viewer scripts with massive processing (loops, for example) or in method calls demanding a long time and also demanding a visual indication for the progress of a process to users.

Due to the general redrawn being a heavy operation, default version of the Refresh method (without the Force parameter) is optimized to ignore redrawn requests from Elipse Power. This standard behavior is ideal for loop progress indications, where a lot of redrawing is performed. The Force parameter disables this optimization, ensuring that for each call to Refresh method, a redrawn is performed. However, when using this option, the Refresh method cannot be called repeatedly, such as inside a loop. Example:

Sub CommandButton1_Click()
  ' Draws a progress bar for an operation
  While i < 31
    Screen.Item("Rectangle2")_
      .HorizontalPercentFill = (i / 30) * 100
    Frame.Refresh True
    ' <-- some lengthy operation -->
  Wend
End Sub

Was this page useful?