What I’m trying to do:
Does anyone know how to exclude the letter “e” from being entered in a textbox when the type is set to number? If statements to exclude it causes a TypeError.
What I’ve tried and what’s not working:
def text_box_user_score_change(self, **event_args):
if self.text_box_user_score.text is not None:
if not isinstance(self.text_box_user_score.text, int) or self.text_box_user_score.text < 0 or self.text_box_user_score.text > 100:
self.text_box_user_score.text = None
Any try/except statement or if statements I use to exclude ‘e’ as a response causes TypeError. Thanks for help.