hi everyone!
i've searched many sites including this one for the answer to me question, but i'm still in a bit of trouble. this is my current code...
everything works fine! BUT, i only want my unitPriceTextBo x to accept ONE decimal point, and only allow TWO numbers maximum after the decimal point, eg. 1234.56 or 45.9 or 45.90. at the moment it obviously accepts unlimited decimal points and allow unlimited numbers after each decimal point.
if anyone could add to my code, or give me new code to help me out, i would greatly appreciate it!
thank you in advance.
:)
i've searched many sites including this one for the answer to me question, but i'm still in a bit of trouble. this is my current code...
Code:
Private Sub unitPriceKeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles unitPriceTextBox.KeyPress If Not (Char.IsDigit(e.KeyChar) Or Char.IsControl(e.KeyChar) Or e.KeyChar = ".") Then e.Handled = True MessageBox.Show("A price can only include numeric digits.", "Numeric Characters Only", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) End If End Sub
if anyone could add to my code, or give me new code to help me out, i would greatly appreciate it!
thank you in advance.
:)
Comment