Solved

textbox validation

Posted on 2009-04-06
1
333 Views
Last Modified: 2013-11-26
hi, quick question, i want to add validation to a text box on my form, what is the easiest way.

the textbox stores time, so i want it to be able to type in 1200 and it split the string and add a : sign, so it would add it as 12:00?

thanks
0
Comment
Question by:kipl20
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 15

Accepted Solution

by:
oobayly earned 125 total points
ID: 24077962
If it's a windows form, you could use a MaskedTextBox control and set the mask property to "0000".

Better yet you could use a DateTimePicker control, and set the Format property to  DateTimePickerFormat.Custom, the CustomFormat property to "HH:mm" and the ShowUpDown property to true.
Then you can retrieve the time as a string using:
Dim timeString As String = dateTimePicker1.Value.ToString("HH:mm")
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

687 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question