text blink

databases United States
  • 19 years ago

    hey guys! any idea on how to make a text blink?



    have you ever encountered setting a label.visible to false at design time and setting it back to true at runtime but it won't show? seems like label.visible=true is not working for me. . .?

  • 19 years ago

    label1.Visible=True
    label1.Refresh


    And depending on the context of the above calls, you may need DoEvents.

  • 19 years ago

    I am not sure if this is the same thing when using forms under a MsAccess platform, but if your label is object dependant... like attached to a textbox or a listbox and if that object is not visible, you won't be able to make the label visible until you make the object visible first.


    Let me know if this isn't the case under plain VB.

  • 19 years ago

    In case you're reffering to labels, the solution is quite easy:


    'Create a label called "Label1" on an empty form


    Sub Form_Activate()
       [Form].TimerInterval=500 'time in millisecs
       varText="TEST"
    End Sub


    Private Sub Form_Timer()
       If [Label1].Visible Then
            [Label1].Visible = False
       Else
            [Label1].Visible = True
       End If
    End Sub


    That should do the job... If you want to do this with a text inside a textbox try the next one:


    'Create a textbox called "Textbox1" on an empty form


    Dim varText As String


    Sub Form_Activate()
       [Form].TimerInterval=500 'time in millisecs
       varText="TEST"
    End Sub


    Private Sub Form_Timer()
       If [Textbox1] = "" Then
            [Textbox1] = varText
       Else
            [Textbox1] = ""
       End If
    End Sub


    This is only for VBA, for VB you will first have to create a Timer Control on your form... Need any help then give me a sign.


    Have fun!


    Regards,


    Thamar

  • 19 years ago

    For the label-solution I just gave you, please forget about the


    varText="TEST"


    I copied this line from the second function... Just cut it and it'll be ok... Anyway, it won't do anything, so it might as well be there ;-)


    Sorry 'bout that...


    Thamar

  • 19 years ago

    hey thanks, i remember we had that on our vb1 exercise.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why. Programmers combine theory and practice: Nothing works and they don't know why.”