Is there a way to make the text in the following code flash on/off every 750ms
Dim Empty As New System.Drawing.Font("Arial", 8, FontStyle.Bold)
e.Graphics.DrawString(
"Empty", Empty, Brushes.Black,97, 153)Ken
e.Graphics.DrawString(
"Empty", Empty, Brushes.Black,97, 153)Ken
How can I make text flash using Graphics.DrawString
KatyTX
formGraphics =
Me.CreateGraphics() Dim Empty As New System.Drawing.Font("Arial", 8, FontStyle.Bold)formGraphics.DrawString(
"Empty", Empty, Brushes.Red, 175, 110)MaqboolHussain
ms-help://MS.VSExpressCC.v80/MS.NETFramework.v20.en/dv_fxmclictl/html/8025247a-2de4-4d86-b8ab-a8cb8aeab2ea.htm
' This variable will be the loop counter. Private counter As Integer Private Sub InitializeTimer() ' Run this procedure in an appropriate event.counter = 0
Timer1.Interval = 600
Timer1.Enabled =
True End Sub Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick If counter >= 10 Then ' Exit loop code.Timer1.Enabled =
Falsecounter = 0
Else ' Run your procedure here. ' Increment counter.counter = counter + 1
Label1.Text =
"Procedures Run: " & counter.ToString End If End SubJr.Coder
mmikedm1000
No fooling with Paint event needed!
Drop a Timer to the Designer of the form where the blinking text will be. Set its Interval property to 750.
In that form's code, select Timer1 in the upper-left combo box, and Tick in the lower-right combo box. A subroutine should be created. Add the following code to that subroutine, using the name of the blinking label or textbox instead of "Blinker", and your color instead of "BlinkColor":
if Me.Blinker.ForeColor = Me.Blinker.BackColor Then
Me.Blinker.ForeColor = Color.BlinkColor
Else
Me.Blinker.ForeColor = Me.Blinker.BackColor
End If
Me.Blinker.Refresh()
Eugene_
You could hook into the onpaint events for the form and include a system timer. With each tick set at 750 change the color of the text.
Dan Thomas - DAGWare
I've tried this code but, it's looking for arguments and I don't know what arguments to use. Can someone please explain this to me.
Thanks,
Ken
Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Clicknumber = number + 1
Label1.Text = number
Me.Refresh() If number >= 25 Then Timer1_Tick() 'What arguments should be used herenumber = 24
Elsenumber = number
End If End SubPrivate
Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim formGraphics As System.Drawing.GraphicsformGraphics =
Me.CreateGraphics() Dim Empty As New System.Drawing.Font("Arial", 8, FontStyle.Bold)formGraphics.DrawString(
"Empty", Empty, Brushes.Blue, 175, 110) End Sub