Thanks for giving me nice suggestions and now I got it ! I'll take care of Cut/copy and Paste functoin as well.
Now, I am using this function !
Public Function AllowNumeric(ByVal e As Object, Optional ByVal IsDecimalAllow As Boolean = True, Optional ByVal IsMinusSignAllow As Boolean = False)
Select Case e.KeyChar
Case Convert.ToChar(8) ' Backspace
Case "0" To "9"
Case IIf(IsDecimalAllow = True, ".", "")
Case IIf(IsMinusSignAllow = True, "-", "")
Case Else
e.Handled = True
End Select
End Function
I appreciate all the help which you all gave to me.
Thanks.
Muhammad Essa Mughal
Software Engineer
iLogic Inc.