That's not a good solution, or even close.
What if I type
1,2345678901234567890123
That's got a comma, so it's allowed 24 digits, but it's way outside your limit.
Or what if I type
Hello, this is a test...
That's also 24 characters, with a comma.
Instead of using a TextBox, use a NumericUpDown, and set the max and min values they can enter. It acts like a textbox, but it won't let the user enter invalid values.
And you do realise how large a number 19 digits is? It fits in an unsigned Int64, but it won't fit in a double or even a decimal. Are you sure that is a valid upper limit for your numbers?