Skip to main content

How to: Sequentially Animate Texts in a Digital Gauge Control

  • 2 minutes to read

The following sample demonstrates how to use creeping line and blinking animation effects to imitate an advertising indicator board.

To accomplish this task, it is necessary to create a CreepingLineAnimation object and assign it to the SymbolViewBase.Animation property. Then, handle the CreepingLineAnimationCompleted event and assign a new BlinkingAnimation object to the SymbolViewBase.Animation property.

Note that in this example, the two texts have a different number of symbols: the first (“Do you want to learn more?”) - 26, the second (“”) - 18 characters.

To prevent animation of space symbols in the second text and demonstrate the creeping line animation for the entire text, the DigitalGaugeControl.SymbolCount, CreepingLineAnimation.StartSpaces and CreepingLineAnimation.AdditionalSpaces properties are set to the values that correspond to the required number of characters.

View Example

Imports Microsoft.VisualBasic
Imports System
Imports System.Windows
Imports DevExpress.Xpf.Gauges

Namespace WpfApplication1

    Partial Public Class MainWindow
        Inherits Window
        Public Sub New()
        End Sub

        Private Sub OnCreepingLineAnimationCompleted(ByVal sender As Object, ByVal e As EventArgs)
            Dim blinking As New BlinkingAnimation()
            matrix.Animation = blinking
            digitalGaugeControl1.Text = ""
        End Sub

    End Class
End Namespace