Jeeves1983

I am displaying the time in my app using :
Private Sub form_load()
Text12.Text = Format(Time, "hh:mm ")
Text11.Text = Format(Date, "dd/mm/yy")
End Sub

The only problem is that the time doesn't update itself along with the system time. How do i make this happen

Please help


Re: Visual Basic General time

Aw Ali

You need to add a Timer object to your form, and in its Tick event, you need to assign the System time to the textBox or label for display. Hope that hint helps.






Re: Visual Basic General time

Jeeves1983

and how do i go about that





Re: Visual Basic General time

Suprotim Agarwal

Dear Jeeves,

You could also try the System.Threading.Thread class as an alternative. The advantages over Timer are that it is light weight.

There is a clean implementation of the same given by Rong-Chun Zhang over here

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1660364&SiteID=1

Also check the msdn article suggested by Rong

Comparing the Timer Classes in the .NET Framework Class Library

HTH,
Suprotim Agarwal

-----
http://www.dotnetcurry.com
-----






Re: Visual Basic General time

Jeeves1983

Thankyou so much. Great help.

I am trying to save data, which i have managed, into a random file, but i am trying to keep what im saving to appear in a list box under headings. Say i wish to save statistics about certain cars, i want to input all the data into text boxes, then when i save them, the data is saved under the car name such as 'porsche 911' in a list box. I can then click on it at any point to recall the information. how do i go about this




Re: Visual Basic General time

kirannandedkar



Can you please elaborate more on your requirement




Re: Visual Basic General time

Jeeves1983

yes

i have a list box, a title box and 12 text boxes which i am going to used to input data. i want to beable to save the data so the data in the text boxes are saved under the name in the title box, which i want to appear in the list box. This way i can open the required information by clicking on the title required in the list box. the info then appears in the relevant text boxes. I basically need code and help as i am a beginner at this.

hope this helps