Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > I got a simple question


Reply
 
Thread Tools Display Modes
  #1  
Old 12-23-2003, 12:29 PM
badgermilk badgermilk is offline
Centurion
 
Join Date: Dec 2003
Location: Arizona
Posts: 119
Default I got a simple question


How do u make a program only be able to to be open for like 5 minuts and have it show on the top of the program?
Reply With Quote
  #2  
Old 12-23-2003, 12:33 PM
capta134's Avatar
capta134 capta134 is offline
Regular
 
Join Date: Dec 2003
Posts: 73
Default

Simply use a timer control and close the program after 5 minutes.
Reply With Quote
  #3  
Old 12-23-2003, 12:35 PM
badgermilk badgermilk is offline
Centurion
 
Join Date: Dec 2003
Location: Arizona
Posts: 119
Default

I no that but i dont know how to code it to work
Reply With Quote
  #4  
Old 12-23-2003, 12:41 PM
Cyroxis's Avatar
Cyroxis Cyroxis is offline
Junior Contributor
 
Join Date: Dec 2003
Location: USA in New Mexico
Posts: 374
Default

To show the time open or left have a timver set to 1 second(100 miliseconds) and have it set the forms caption to form1.caption = "Form1" & <current time>. As for being open for 5 minuts, you can set a timer for 5 minuts (not recomended becuase you already have a timer for 1 second) or just use the 1 second timer to add 1 to a varible every second and when the varible = 5*60(5 minuts) close the program.
Now the only problem you will have it the foms caption will display the time open in seconds (you can do time till close as 5*60 - time open). to display the time in minuts you simply hacve to have a function taht converts seconds into minuts and seconds sumting like
Private Function Convert(Seconds as Int) as string

Convert = int(Seconds/60) * (Seconds mod 60)

end Function

Check to make shrue the function works i just made it up on the spot i have not tested it
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple ADO/sql question seidenstud Database and Reporting 5 12-06-2002 03:01 PM
A Simple Question...... SolarCoasters General 5 11-07-2002 03:04 PM
Simple UDT question. Mithrandel General 3 03-09-2002 09:49 AM
simple question..possibly? jcd Database and Reporting 12 11-02-2001 01:26 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->