Flashing Text

  • Thread starter Thread starter ukjock
  • Start date Start date
U

ukjock

Can somebody please help me on how to make text flash using a timer.

Is using a timer the ideal way or is there an easier way!?

I wanted to use:

If Label2.ForeColor.Red Then
Label2.ForeColor.Empty() Else Label2.ForeColor.Red()


but i get system.color can not converted to Boolean.

Can somebody please help me... I am pulling my hair out!

Regards

Chris
 
I'm not sure about the best way to flash the text, but try

If Label2.ForeColor.Equals(System.Drawing.Color.Red) Then
Me.ForeColor = Me.BackColor
Else
Me.ForeColor = System.Drawing.Color.Red
End If

ukjock said:
Can somebody please help me on how to make text flash using a timer.

Is using a timer the ideal way or is there an easier way!?

I wanted to use:

If Label2.ForeColor.Red Then
Label2.ForeColor.Empty() Else Label2.ForeColor.Red()


but i get system.color can not converted to Boolean.

Can somebody please help me... I am pulling my hair out!

Regards

Chris
 
I am not positive but.Empty might be returning a boolean expression if
the forecolor is chosen or not.

What is the color you want if you want blue for example just change
..empty to .blue and it should work.

Keep in mind flashing text can get very annoying to the end user
depending on what type of app you are writing.

Oh, and dont forget the End If there! :)

-Ivan
 
* (e-mail address removed)-spam.invalid (ukjock) scripsit:
Is using a timer the ideal way or is there an easier way!?

I wanted to use:

If Label2.ForeColor.Red Then
Label2.ForeColor.Empty() Else Label2.ForeColor.Red()

\\\
If Label2.ForeColor.Equals(Color.Red) Then
Label2.ForeColor = Color.Transparent
Else
Label2.ForeColor = Color.Red
End If
///
 
Hi Ukjock,

This is a sample I took the coloring from Herfried.
I used the system.windows.forms.timer for this sample.
It is not tested, just pasted from all things in this message.


Label2.Text = "Hello"
timer2.Enabled = True
timer2.Interval = 1000
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles timer1.Tick
If Label2.ForeColor.Equals(Color.Red) Then
Label2.ForeColor = Color.Transparent
Else
Label2.ForeColor = Color.Red
End If
End If
End Sub

I hope this helps.

Cor
 
Back
Top