You don't need to declare a var with TryParse, do it like this
Add this class to your project (makes it reusable), it's known as a language extension.
public static class StringExtensions
{
public static bool IsNumeric(this string text) => double.TryParse(text, out _);
}
Use it
if (txtCardNumber.Text.IsNumeric())
{
}
Using double indicates it can represent an int, double essentially a number