Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3280

Who used property CanBeCanceled from Progress Method ?

$
0
0

Hi,

 

Preamble : First we have none problem with progress bar when we set InStatusbar to FALSE and thatwe do not use CanBeCanceled property.

 

My question : Is thereanyone who has used the property CanBeCanceled?

 

Example :

 

We create status Bar

' Create the requested kind of progress indicator...

Set p = Application.Progress("Progress indicator demo...", InStatusbar)

 

MetaModel Help say :

 

If InStatusbar Then

' Status bar progress indicator supports a Can-Be-Canceled property

p.CanBeCanceled = True

end If

 

The ProgressStatusBar class represents a GUI progression indicator that is wrapped in the status bar.

 

Prerequisites:

With this kind of progression indicator, it is necessary to provide a progression range. The action which progression is shown may not be interruptible.

 

Progress :

Min . This attribute is the progression range minimum value.

Max:  This attribute is the progression range maximum value.

Position: This attribute is the current position in progression range.

Stepping:  This attribute is the progression range increment value used by Step method.

Text: This attribute is the current action text description.

Text2:  This attribute is the secondary text description.

BarColo: This attribute is the progression bar base color.

BackColor: This attribute is the progression bar background color.

 

ProgressStatusBar :

 

CanBeCanceled : Get or set Can Be Cancelled. This attribute can be set to FALSE if action which progression is shown cannot be interrupted.

NOTE: even if the action progression cannot be cancelled, either Step or Canceled methods must still be called repeatedly for the display to be updated correctly.

 

A) We start our script from PowerDesigner Menu

 

B) When InStatusbar is set to TRUE - None pop-up Windows is displayed - Progress or Progress Status Bar

 

C) None visible effect when we set InStatusbar to TRUE and we set p.CanBeCancelled to TRUE or FALSE

 

D) For information : Youcan't use p.CanBeCancelled if InStatusbar is set to FALSE. it's not supported.

*************************************
Sub DemoProgression(InStatusbar, Affichage)

Dim p

 

' Création de la barre de progression...

Set p = Application.Progress("Barre de progression...", InStatusBar)

 

' Plage de l'indicateur de progression et de sa position initiale

p.Position = 0 ' Defaults to 0

p.Stepping = 1 ' Defaults to 10

 

' Modification des couleurs de progressions.

p.BarColor = vbGreen

p.BackColor = vbRed

 

p.Min = 0 ' Defaults to 0

p.Max = 100 ' Defaults to 1000

 

' L'utilisateur peut annuler la progression

p.CanBeCanceled = True

 

' Affichage de l'indicateur de progression

p.Start

 

Dim i, j, k

 

For i = 1 To 100 Step 1

   p.Step

   p.Text = CStr(i)

 

   delai(1) -- my own sleep function

 

   If p.Canceled Then

      p.Stop

      Exit Sub

   End If

Next

 

p.Stop

End Sub


Viewing all articles
Browse latest Browse all 3280

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>