how to flashing two image ?
attached the image
alternate the two color image:
yellow
red
yellow
red
ecc...
Printable View
how to flashing two image ?
attached the image
alternate the two color image:
yellow
red
yellow
red
ecc...
Timer and 2 picture boxes?
Timer and 1 PictureBox, but 2 BitMaps.
Just Load alternate BitMap on Timer-Event, or load both into Memory, and then just assign on Timer-Event
Probably needs Repainting/Refresh, too.
If it's really just those small squares, a Label might be an Option.
No Caption, Autosize=False, Background opaque, and then just set Background-Color on Timer-Event
Ask AI. :p
I that the job now, "Ask AI" when we know AI makes too many mustkes. Quote from AI. lol
Use a Shape, FillStyle = 0 (solid). Change the FillColor with a timer.
what Arnoutdv wrote. this is where u start. u use what VB offers. its simple. its intuitive. its learning exercise.
later when you ready, u will be ready for more.
if u can't even use the common component of VB u should just quit trying. this after 20+ years.
shape is good, but not as good as a picturebox.
shape has the same issue like an image object, they can flicker.
even so, to realize that, u need to try it. thats when u see the good and the bad.
thats when u evolve and start looking for something that can fix the limitations.
nothing fancy...
2x Shape
1x Timer
set your timer Interval as you need it
Code:
Private Sub Form_Load()
Shape1.FillStyle = 0
Shape1.Height = 330
Shape1.Left = 2415
Shape1.Top = 1995
Shape1.FillColor = vbYellow
Shape2.FillStyle = 0
Shape2.Height = 330
Shape2.Left = 2415
Shape2.Top = 1995
Shape2.FillColor = vbRed
Timer1_Timer
End Sub
Private Sub Timer1_Timer()
Shape2.Visible = Not Shape2.Visible
End Sub
Alternative to Chris with 1 Shape
Untested
Code:Private col(0 To 1) As Long
Private Sub Form_Load()
col(0) = vbYellow
col(1) = vbRed
Shape1.FillStyle = 0
'Where's "Width"? :)
Shape1.Height = 330
Shape1.Left = 2415
Shape1.Top = 1995
Shape1.FillColor = col(0)
Timer1_Timer
End Sub
Private Sub Timer1_Timer()
Static a As Long
If a = 0 Then a = 1 Else a = 0
Shape1.FillColor = col(a)
End Sub