Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hello coders,

I have a DataGridView on a form, that loads data from a database.

Two of the columns (TimeStart, TimeEnd) in this DataGridView are time specific, ie: 13:30 or 09:55

I need some sort of formatting that means the user can only type in 4 numeric characters, then a colon is placed after the first two once the four characters have been typed.

For example:

1. User enters a cell, the value in the cell is highlighted.
2. User types in: 1250
3. Once the last character has been typed, a colon is placed after the second character.
4. User leaves cell, and value stands at: 12:50

Any comments and answers are greatly appreciated, thanks.
Posted

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900