stopping timers with edges?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, i have a game im programming where a i need a timer to be disabled if a
buttons top edge hits the bottom edge of a label but nothing i try seems to
work. Also i need it to stop the timer if it hits a labels left and top edges
but nothing works......help!
 
Hi,

Post some code

Ken
----------------------
Hi, i have a game im programming where a i need a timer to be disabled if a
buttons top edge hits the bottom edge of a label but nothing i try seems to
work. Also i need it to stop the timer if it hits a labels left and top
edges
but nothing works......help!
 
If Me.btnplayer.Top = Me.Label5.Bottom Then
Me.Timer1.Enabled = False
End If

or


If me.btnplayer.location.equals(me.label5.location) then
me.timer1.enabled=false
end if

or

If me.btnplayer.location.y = me.label5.location.y + me.label5.height then
me.timer1.enabled=false
end if
 
Hi,

Use Rectangle.intersectswith to see if they overlap.

http://msdn.microsoft.com/library/d.../html/frlrfsystemiobinaryreaderclasstopic.asp

if label5.clientrectangle.intersectswith(btnplay.clientrectangle) then
Me.Timer1.Enabled = False
End If


Ken
------------------------
If Me.btnplayer.Top = Me.Label5.Bottom Then
Me.Timer1.Enabled = False
End If

or


If me.btnplayer.location.equals(me.label5.location) then
me.timer1.enabled=false
end if

or

If me.btnplayer.location.y = me.label5.location.y + me.label5.height then
me.timer1.enabled=false
end if
 
I tried that and the timer starts within a second of starting. i debugged and
it found the two intersecting when they arent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top