I have been creating a program for my poker buddies that has a countdown clock. I was trying to figure out how to signal the clock stopping. Then I thought of using a flashing screen to signal the end. Any thoughts on how to do this as I have tried and when put into a loop, it goes too quickly. I thought of using a timer to slow down the background changing. Any suggestions?
Creating a flashing screen
Page 1 of 16 Replies - 15307 Views - Last Post: 18 October 2007 - 11:36 AM
Replies To: Creating a flashing screen
#2
Re: Creating a flashing screen
Posted 17 August 2007 - 09:11 PM
Tie it to a Timer Control, then set the interval of the timer to your desired rate.
#3
Re: Creating a flashing screen
Posted 13 October 2007 - 04:11 PM
I would like to do the same thing
can you point me in the direction to do this.
can you point me in the direction to do this.
#4
Re: Creating a flashing screen
Posted 13 October 2007 - 10:07 PM
Working with the Timer Control in VB.NET
That tutorial explains fairly well how to use the timer control for VB.NET.
Use that, and change the backcolor and/or forecolor property of whatever you want to flash to change with your timer_tick.
That tutorial explains fairly well how to use the timer control for VB.NET.
Use that, and change the backcolor and/or forecolor property of whatever you want to flash to change with your timer_tick.
#5
Re: Creating a flashing screen
Posted 18 October 2007 - 10:02 AM
Here I got bored and tried to make some code for you. Ive Made it in visual basic 2005 express edition so it should work.
Components
-Timers
--Flasher1
--Flasher2
--Countdown
-Variables
--time
--flash
-Other
--label1
once the time = 5 the screen will start flashing black and white
hope it works
Ps. im 13 so if the code sucks sorry
Components
-Timers
--Flasher1
--Flasher2
--Countdown
-Variables
--time
--flash
-Other
--label1
Public Class Form1 Public time As Long Public flash As Boolean Private Sub Flasher1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Flasher1.Tick If flash = False Then flash = True Me.BackColor = Color.White End If flasher2.Enabled = True End Sub Private Sub Flasher2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles flasher2.Tick If flash = True Then Me.BackColor = Color.Black flash = False End If End Sub Private Sub Countdown_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Countdown.Tick time = time + 1 Countdown.Enabled = True Label1.Text = time If time = 6 Then Flasher1.Enabled = True Label1.Hide() End If End Sub End Class
once the time = 5 the screen will start flashing black and white
hope it works
Ps. im 13 so if the code sucks sorry
#6
Re: Creating a flashing screen
Posted 18 October 2007 - 10:44 AM
Hm, interesting way of going about it Shadow 1.2. Though perhaps a bit overly complex, this would be handy if you wanted the form to flash in different increments (say white for 2 seconds, black for 1).
Here's how I personally would've done it just to show you how it can be done with one timer (not including the countdown timer).
Then, when you want the form to start flashing (probably based off the countdown timer in this instance) you would just enable this timer.
Just food for thought on a simpler way to do it with the same timer interval for both changes.
Here's how I personally would've done it just to show you how it can be done with one timer (not including the countdown timer).
Private Sub tmrFlash_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrFlash.Tick If Me.BackColor = Color.Black Then Me.BackColor = Color.White ElseIf Me.BackColor = Color.Black Then Me.BackColor = Color.White Else Me.BackColor = Color.White End If End Sub
Then, when you want the form to start flashing (probably based off the countdown timer in this instance) you would just enable this timer.
Just food for thought on a simpler way to do it with the same timer interval for both changes.
#7
Re: Creating a flashing screen
Posted 18 October 2007 - 11:36 AM
aceofspades686, on 18 Oct, 2007 - 10:44 AM, said:
Hm, interesting way of going about it Shadow 1.2. Though perhaps a bit overly complex, this would be handy if you wanted the form to flash in different increments (say white for 2 seconds, black for 1).
Here's how I personally would've done it just to show you how it can be done with one timer (not including the countdown timer).
Then, when you want the form to start flashing (probably based off the countdown timer in this instance) you would just enable this timer.
Just food for thought on a simpler way to do it with the same timer interval for both changes.
Here's how I personally would've done it just to show you how it can be done with one timer (not including the countdown timer).
Private Sub tmrFlash_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrFlash.Tick If Me.BackColor = Color.Black Then Me.BackColor = Color.White ElseIf Me.BackColor = Color.Black Then Me.BackColor = Color.White Else Me.BackColor = Color.White End If End Sub
Then, when you want the form to start flashing (probably based off the countdown timer in this instance) you would just enable this timer.
Just food for thought on a simpler way to do it with the same timer interval for both changes.
I thought the code got a bit long, thanks for the correction
Page 1 of 1

New Topic/Question
Reply



MultiQuote




|