I'm sorry if the title is wrong I didnt know how is called what I want to do.
Im starting in C# (Python is my strong).
The thing that I want to do in C# is, I dont know how to explain, but I will put how you can do it in python.
I want to show different message depends of the action, but I not want use a lot of If's.
Right now in C# I have a textBox with the KeyDow event, so if I press number I want that show "You pressed a number" but if I press a dot (.) it will tell me "You pressed a dot".
in python I would do like that:
def keyDownEvent(self, k):
if k.key.text in [1,2,3,4,5,6,7,8,9,0]:
print(f"You pressed {k.key.text}")
else:
print("You pressed " + {"decimal": "dot", "OemPeriod": "dot"}[k.key.text])
this is a example how I would do in python, and inside of this temporary dictionary I can put more stuffs..
how I can do something like that in C#?