Can Any One help with some simple Text Box VALIDATION Please Urgent

Comments
--reputation

Why is it so urgent?
Is your house on fire?
Don't post a message here in red. IT HAS THE SAME EFFECT AS SHOUTING!!!

Look in the code snippet section and you will certainly find what you where looking for. If not, come back here.

Edited 5 Years Ago by ddanbe: typo

You can test is in this way:
put on the from:
- textBox
- button
- label

Now create a method for a button_Click event and put use this code on it:

private void button1_Click(object sender, EventArgs e)
        {
            string sValue = textBox1.Text;
            int intValue = 0;
            decimal decValue = 0M;
            
            bool bValidating = int.TryParse(sValue, out intValue);
            if (!bValidating)
            {
                bValidating = decimal.TryParse(sValue, out decValue);
                if (!bValidating)
                    label1.Text = sValue + " is a string";
                else
                    label1.Text = sValue + " is a decimal";
            }
            else
                label1.Text = sValue + " is a integer";
        }

Hope it helps,
Mitja

Sure you can, but the Validating even it self will do nothing. You have to put the code inside of it, ok ?

Mitja

hmmmmmm Ok i will try
But Can you help me with different Examples not only this since i am new to C#

This question has already been answered. Start a new discussion instead.