ProgressBar Function
Creates a ProgressBar object.
[ActiveDocument.]ProgressBar (dashboard[, left[, top[, width[, height[, value[, maxvalue]]]]]])
Arguments
- dashboard
- Required. The dashboard object on which to place the progressbar.
- left
- Optional. The number of pixels from the left edge of the dashboard to place the left edge of the progressbar. Zero if omitted.
- top
- Optional. The number of pixels from the top edge of the dashboard to place the top edge of the progressbar. Zero if omitted.
- width
- Optional. The number of pixels wide to draw the progressbar. 100 if omitted.
- height
- Optional. The number of pixels tall to draw the progressbar. 20 if omitted.
- value
- Optional. The initial value of the progressbar. This value is divided by maxvalue to determine what portion of the progressbar is filled.
- maxvalue
- Optional. The maximum value of the progressbar.
Return Value
The ProgressBar function returns a ProgressBar
object that can be used to inform the user of the status of a process.
Remarks
The following example uses ProgressBar to create a progressbar object and display progress:
var dash = ActiveDocument.Sections["Dashboard"];
dash.pb0001 = new ActiveDocument.ProgressBar(dash);
with (dash.pb0001) {
Left(300);
Top(200);
Height(32);
Width(160);
Value(0);
MaxValue(100);
Show();
for (var i = 1; i <= dash.pb0001.MaxValue() / 2; i++) {
var a = (new Date()).valueOf();
while ((new Date()).valueOf() - a < 10) {
DoEvents();
DoEvents();
}
dash.pb0001.Value(i * 2);
}
}
Requirements