Mode: RibbonProgressBarMode;
Mode: Prognoz.Platform.Interop.Forms.RibbonProgressBarMode;
The Mode property determines mode of the component indicator displaying.
Two modes of indicator displaying are available for the component: standard () and endless ().
Visual displaying of the animated indicator in the infinite mode is available, if the following formatting themes are used:
Microsoft Office 2007;
Microsoft Office 2010;
Carbon;
Windows 7 (when using Windows 7 operating system and activated Aero formatting theme).
Executing the example requires a form, the Ribbon component named Ribbon1 positioned on it, the Timer component named Timer1 and two buttons named Button1 and Button2. The buttons are used to activate and deactivate a timer. The ribbon is loaded in the Ribbon1 component. Two indicators of process are placed on the first panel of the active ribbon tab.
Class TestForm: Form
Ribbon1: Ribbon;
Button1: Button;
Button2: Button;
Timer1: Timer;
Progress1, Progress2: IRibbonProgressBar;
i: Integer;
Const MaxValue = 100;
Sub TestFormOnCreate(Sender: Object; Args: IEventArgs);
Var
RPanel: IRibbonPanel;
Begin
RPanel := Ribbon1.ActiveCategory.Panels.Item(0);
Progress1 := RPanel.Elements.Item(0) As IRibbonProgressBar;
Progress2 := RPanel.Elements.Item(1) As IRibbonProgressBar;
Progress1.Mode := RibbonProgressBarMode.Infinite;
Progress2.Mode := RibbonProgressBarMode.Normal;
Progress1.Maximum := MaxValue;
Progress2.Maximum := MaxValue;
End Sub TestFormOnCreate;
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Begin
Timer1.Enabled := True;
End Sub Button1OnClick;
Sub Button2OnClick(Sender: Object; Args: IMouseEventArgs);
Begin
Timer1.Enabled := False;
End Sub Button2OnClick;
Sub Timer1OnTimer(Sender: Object; Args: IEventArgs);
Begin
If i = MaxValue Then
i := 0;
End If;
i := i + 1;
Progress1.Value := i;
Progress2.Value := i;
End Sub Timer1OnTimer;
End Class TestForm;
Pressing the Button1 button activates the timer after form launching. The value that is displayed on the indicators of process is changed in the timer event. If the Carbon formatting theme is used, the process looks visually like that:
See also: