Oct 15th, 2002, 06:39 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] Increase/Decrease the time in a text box
I want to increase the mins/hours/seconds in a text box which holds the time. How is this done?
Thanks
Last edited by TomGibbons; Oct 17th, 2002 at 11:15 AM .
Oct 15th, 2002, 06:41 AM
#2
Use a Timer...
VB Code:
Private Sub Timer1_Timer()
Text1.Text = Format$(Now,"hh:mm:ss")
End Sub
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
Oct 15th, 2002, 06:48 AM
#3
Thread Starter
Frenzied Member
No, I want to change it. It is an input. I want to have a button to make the hours/mins increase or decrease. Thanks though
Oct 15th, 2002, 06:49 AM
#4
Why a textbox and not a label???
Woka
Oct 15th, 2002, 06:50 AM
#5
Thread Starter
Frenzied Member
Well ok, a label then. Whatever...can it be done?
Oct 15th, 2002, 06:54 AM
#6
yep, use the DateAdd function (see VB help for the various parameters you can use)
Oct 15th, 2002, 06:56 AM
#7
Yea, use MS datepicker control...windows common control 2
Just set the format to display time and you're away
Woka
Oct 15th, 2002, 07:01 AM
#8
Junior Member
Originally posted by TomGibbons
No, I want to change it. It is an input. I want to have a button to make the hours/mins increase or decrease. Thanks though
use updown and text controls to reslove it?
Oct 15th, 2002, 07:12 AM
#9
Attached Files
Oct 15th, 2002, 07:14 AM
#10
Thread Starter
Frenzied Member
Originally posted by si_the_geek
yep, use the DateAdd function (see VB help for the various parameters you can use)
This can be used for time?
Oct 15th, 2002, 07:16 AM
#11
yep - you can use years, days, hours, seconds, etc etc...
Oct 15th, 2002, 07:18 AM
#12
Thread Starter
Frenzied Member
Originally posted by si_the_geek
yep - you can use years, days, hours, seconds, etc etc...
umm can you please give me an example how?
Oct 15th, 2002, 07:20 AM
#13
This will add 32 seconds to "my_date":
my_date = dateadd("s",32,my_date)
see VB help for the list of parameters you can use
Oct 15th, 2002, 07:23 AM
#14
Thread Starter
Frenzied Member
Originally posted by si_the_geek
This will add 32 seconds to "my_date":
my_date = dateadd("s",32,my_date)
see VB help for the list of parameters you can use
Thanks, I'll be home in about an hour so I'll try it then.
Oct 15th, 2002, 07:26 AM
#15
I am confused...
Why go through all that trouble when there is a VB control that has already been invented that will do exactally what you want...?
Woka
Oct 15th, 2002, 08:43 AM
#16
Thread Starter
Frenzied Member
Originally posted by Wokawidget
I am confused...
Why go through all that trouble when there is a VB control that has already been invented that will do exactally what you want...?
Woka
Oops, I didnt notice your post. Cheers woka, thats perfect
Oct 15th, 2002, 08:47 AM
#17
D'oh!
Woka
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width