Flashing text in buttons

Discussion in 'Questions (Windows Mobile)' started by cdeane, Apr 14, 2008.

  1. cdeane

    cdeane Member

    I need some basic code to make the text in my buttons to flash on and off.
    Ex: blue to red and back every second.
     
  2. taximania

    taximania Well-Known Member Licensed User

    Here's a start. I'm sure using one of the libraries you can adjust the Border colours.

    Code:
    Sub Globals
       
    'Declare the global variables here.
       flag=0
    End Sub

    Sub App_Start
       Form1.Show
       button1.FontColor=cred
       timer1.Enabled=
    true
    End Sub


    Sub Timer1_Tick
       
    If flag=0 Then
       button1.FontColor=cblue
       flag=
    1
       
    Return
       
    End If
       
    If flag=1 Then
       button1.FontColor=cred
       flag=
    0
       
    Return
       
    End If
       

    End Sub
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    Small modification for developers who like short code:
    Code:
    Sub Globals
       
    'Declare the global variables here.
    End Sub

    Sub App_Start
       Form1.Show
       button1.FontColor=cred
       timer1.Enabled=
    true
    End Sub


    Sub Timer1_Tick
       
    If button1.FontColor = cRed then button1.FontColor = cBlue else button1.FontColor = cRed
    End Sub
     
  4. cdeane

    cdeane Member

    Great

    Thanks a lot to all.
     
  5. taximania

    taximania Well-Known Member Licensed User

    I hate If ... Else ... 1 liners.
    They never work for me :eek:
     
  6. Cableguy

    Cableguy Expert Licensed User

    I share your hate my friend.....

    Try some yoga before using it, it works for me.....;)
     
  7. taximania

    taximania Well-Known Member Licensed User

    Ha ha ha, try some beer .....:sign0060:

    ;) Hi Paulo
     
Loading...