I am struggling to do a project in Visual Basic 2010, I need to make a replication of the New Years Eve ball droping in New York City. The balls has to drop for 30 seconds and can be stoped at any time, it also must include a timer starting from 30 seconds and counting down and must also stop. The ball and timer must be able to stop using the same button. Lastly at the end of the 30 seconds the words Happy New Years must appear on the screen. If someone has an idea of what the code should be please send it to me as soon as you possible can.

Any help would be apperciated.

Create a timer, delclare a public variable with the value of 30 and set the interval to 1000 miliseconds (1 second) then in the timer place the code.

public var as integer = 30

'In the timer.tick event.'

var -= 1
ballLocation = new Point(ballLocation.x, ballLocation.y - 1)

If var = 0 Then
    MsgBox("Happy New Years!")
End If

Fire this code from a start button

timer.Start()

Fire this code from the stop button

timer.Stop()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.