Jump to content

[vb8] duraçao de um periodo de tempo


david_carlos
 Share

Recommended Posts

Bem... Precisas de um timer e configurá-lo para executar os ciclos de seg a seg.

Capturas o evento Tick... e ai dentro vais retirando um valor à label. Quando chegar a zero, desligas o timer, e apresentas a mensagem.

Oracle Certified Professional - AdministraçãoOracle Certified Professional - Pl/sqlMCPD - Microsoft Certified Professional DeveloperMCTS - Microsoft Certified Technology Specialist

Link to comment
Share on other sites

Boas

podes me arranjar o codigo sff?

Já tens alguma coisa feita ? É mais ou menos isto:

Public Class Form1

    Private WithEvents tm As New Timer
    Private counter As Byte

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        counter = 10
        tm.Interval = 1000
        tm.Start()
    End Sub

    Private Sub tm_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles tm.Tick
        counter -= 1
        If counter <= 0 Then
            tm.Stop()
            MessageBox.Show("Done!")
        End If
    End Sub

End Class
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.