Wrox Programmer Forums
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 26th, 2004, 04:01 AM
Authorized User
Join Date: Apr 2004
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Default VB6 How to

How to format the textbox as "H:mm:ss" EX: when the user type 122040
then it will be format to 12:20:40:PM
Thank for your reply !

Old July 26th, 2004, 04:05 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts

You can use the MaskEdit control instead of the TextBox
Old September 30th, 2004, 06:08 AM
Authorized User
Join Date: Sep 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Lalit_Pratihari


Yes you can use a MaskEdit Control or if you want to do it in a Textbox only then you can use the MID() function.

Dim HH as String
Dim MM as String
Dim SS as String
Dim MyTime as String

If Len(Text1.text) = 6 then
 HH = Mid (Trim(Text1.text), 1, 2)
 MM = Mid (Trim(Text1.text), 3, 2)
 SS = Mid (Trim(Text1.text), 5, 2)
 MyTime = HH & ":" & MM & ":" & SS
End If

Hope this helps,

Life Means More...;)

Similar Threads
Thread Thread Starter Forum Replies Last Post
SUB NAME IN VB6 Nadalik VB How-To 2 June 21st, 2006 03:30 AM
COM Implementation using VB6 haianoop Pro VB 6 0 December 28th, 2005 04:01 PM
VB6 how to use a COM+ pevl VB Components 3 November 26th, 2005 09:16 AM
Where to get VB6 HaXXeD Beginning VB 6 2 December 5th, 2003 04:21 PM
VB6 ?? wickman Wrox Book Feedback 1 June 5th, 2003 08:50 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.