It depends on when you want to return that message.
You can always check the TextBox.Text property using the Microsoft.VisualBasic.Information.IsNumeric function; either when the text is validated or when you press a button.
You can also handle the keypress event of the textBox and check whether the key being pressed is a number, if not set the KeyPressEventArgs.Handled (e.Handled) to true which will block the processing of said key. You could subclass the textbox class to create a numeric only textbox using this method.
Im really new at this so thanks for your help. I tried that and that does not allow the use of a decimal or leave the ability to "backspace" in the cell.
Any other suggestions?
Again thanks for your help.
Mabey this will help im trying to have textbox inputs that will send input values to a dynamic array, so really I just need to validate that the input can be used in a mathmatical equation before its sent to the array. Again im new at this so im not sure if im explaining it correcly, thanks
Or maybe thats not even what i need to do, Maybe you can help me with a better direction. I need to have X sets number of inputs, (user driven) and for each set of inputs I have the same formulas to run across each of them. Any Suggestions would be greatly appreciated.
Private Sub TextBoxCompanyID_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBoxCompanyID.KeyPress
'Allows only numeric values into the companyID textbox
If Asc(e.KeyChar) <> Keys.Back And Asc(e.KeyChar) <> Keys.Decimal Then
If e.KeyChar.IsNumber(e.KeyChar) = FalseThen
e.Handled = True