Button text blink

Posted by: fsegui on 14 July 2020, 11:31 pm EST

  • Posted 14 July 2020, 11:31 pm EST

    Hello,

    I try to make the text property of C1Button to blink. It works well with a native winform button with the following code but I cannot get it to work with C1Button. W:

    Private Sub btnBlinck(ByRef xbTrueOrFalse As Boolean)
    If xbTrueOrFalse = True Then
    If btnSave.ForeColor.Equals(System.Drawing.Color.Blue) Then Exit Sub

    btnSave.ForeColor = System.Drawing.Color.Blue
    tmrSave.Interval = 300
    tmrSave.Enabled = True
    Else
    If btnSave.ForeColor.equals(System.Drawing.SystemColors.ControlText) Then Exit Sub
    btnSave.ForeColor = System.Drawing.SystemColors.ControlText
    tmrSave.Enabled = False
    End If
    System.Windows.Forms.Application.DoEvents()
    End Sub

    Private Sub tmrSave_Tick(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles tmrSave.Tick
    btnSave.ForeColor = IIf(btnSave.ForeColor.Equals(System.Drawing.Color.Blue), System.Drawing.SystemColors.ControlText, System.Drawing.Color.Blue)
    End Sub
  • Replied 15 July 2020, 3:58 pm EST

    Hi Florent,

    I have attached a sample which shows blinking text in the C1Button.
    If you are doing something else as implemented in the sample then please let us know and modify the sample accordingly.

    Regards,
    Prabhat Sharma.
    BtnBlinkDemo.zip
  • Replied 15 July 2020, 7:58 pm EST

    Hi,

    Yes, I forgot to mention that the form also has a C1ThemeController on it.
    Even if I set to "none" the theme on the C1Button, it does not blink.
  • Replied 15 July 2020, 9:46 pm EST

    Hello,

    Sorry, but we did not face the issue by using C1ThemeController at our end.
    We have modified the last attached sample implementing the same, please have a look.

    Regards,
    Prabhat Sharma.
    BtnBlinkDemo_Mod.zip
  • Replied 15 July 2020, 10:06 pm EST

    Hi,
    I've updated the first sample with C1ThemeController. It does not work (but your second sample works)
  • Replied 15 July 2020, 10:06 pm EST

    BtnBlinkUpdated.zip
  • Replied 16 July 2020, 5:20 pm EST

    Hi Florent,

    In your last attached post, the VisualStyle property of C1Button is Custom, please change it to System to make the sample work as desired:
    Me.C1Button1.VisualStyle = C1.Win.C1Input.VisualStyle.System


    Regards,
    Prabhat Sharma.
  • Replied 20 July 2020, 7:25 am EST

    Hi Prabhat Sharma,

    Even if I update to System, if I set to (default) the Theme on the C1Button, it does not blink. How is it possible to apply a custom theme and make the button blink?
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels