instead of writing lots of code why dont u use third party controls or masked edit itself...