You need to code more defensively than that, you are assuming that (2, 7) is always going to refer to a position within your string.
But what if I entered '10ABC' into your tbxUserID? Then the second argument (7) isn't valid and you are going to see the error you're struggling with
I don't know what you're trying to do, are you trying to find a string and remove sections that match?
string UserID = tbxUserID.Text;
string UserIDSort = UserID.Remove(2, UserID.Length - 2);
This way, the length of UserID can change and your calculation is still valid
You could probably just do this with a substring if the code is always 2 long?
UserIdSort = UserID.Substring(0, 2);