Can someone explain how to use TryParse in C# Visual Studio to validate some textbox. I need a function using TryParse, I have an idea but it's not working
public void Letra(TextBox caja)
{
   char valor;
   if(char.TryParse(caja.Text, out valor))
   {
        if (caja.TextLength>1)
        {
            caja.Text = caja.Text.Remove(caja.TextLength);
            caja.SelectionStart = caja.TextLength;
        }
   }
}
 
     
     
     
     
    