tags:

views:

59

answers:

2

I am new to dotnet. I have an application with one login screen and three other screens. On login user can go to any of the other three screens by selecting the options. On all three screens i have a Picture box which i need to update the Image every one minute based on some logic.Can you please help me on how to do it.

Note: I have a base form, all the forms are inherited from Baseform User can go only to one form at a time Using VS2003

A: 

Something like this

Private WithEvents myTimer As New Timer

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    myTimer.Interval = (60 * 1000)
    myTimer.Start()
End Sub

Private Sub myTimer_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles myTimer.Tick
    myPicturebox.Image = MyLogicthatreturnAnImage
End Sub
Fredou
Can i have a thread in my main page and can this thread update picture box in each form
A: 

You can use a Timer component. Here's the code in C#:

var timer=new Timer()
timer.Tick+=DrawPicture;
timer.Interval=60000;// its in miliseconds

Now every time you want to start the timer you just set its enable property to true:

timer.Enable=true;
Beatles1692