Click here to Skip to main content
11,721,385 members (83,133 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: VB.NET
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
0 Sergey Alexandrovich Kryukov 440
1 OriginalGriff 229
2 Mika Wendelius 170
3 F-ES Sitecore 80
4 cyycoish 70
0 Sergey Alexandrovich Kryukov 2,209
1 OriginalGriff 969
2 F-ES Sitecore 660
3 Maciej Los 609
4 Richard MacCutchan 560

Advertise | Privacy | Mobile
Web02 | 2.8.150901.1 | Last Updated 11 Dec 2012
Copyright © CodeProject, 1999-2015
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