For that, for your case, you will need to have an enum type, not integer type. Enum types can be used in such cases, where you can have visuals in the programming and then use their values and so on. For example, the following enum,
enum Days {
Monday = 1,
Tuesday = 2,
Wednesday = 3,
Thursday = 4,
Friday = 5,
Saturday = 6,
Sunday = 7
}
Now, when you get the user input, you can simply cast it to this enum value, but here the casting from string to integer will be required,
Console.WriteLine((Days) 1);
But the casting from string will not work, and will never work because you cannot cast from String to Days. In the case of fetching the value from TextBox, same case applies, you need to first convert the value to integer, by parsing it, then you need to convert it to the name and print it.
For an example, please see,
Home | .NET Fiddle[
^], you may also have a look at the following MSDN documentation,
Enum.ToString Method (System)[
^]