How to update form or button event automatically?

0

How do I automatically update a Private Sub _PAINEL_VENDAS_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load and an event for example button ?

Do I have to use a timer?

    
asked by anonymous 05.02.2014 / 15:07

1 answer

1

Try this:

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        ' Aqui seu codigo do botao
    End Sub

    Private Sub _PAINEL_VENDAS_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load    
        Dim timer = New Timer
        timer.Interval = 2 * 1000 ' 2 segundos
        AddHandler timer.Tick, AddressOf Button1_Click
        timer.Start()
    End Sub
    
06.02.2014 / 19:13