Click here to Skip to main content
13,004,099 members (112,916 online)
Rate this:
Please Sign up or sign in to 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 10-Dec-12 23:59pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1


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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170627.1 | Last Updated 11 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100