i have calculator wpf interface, , there grid containing of buttons. want these buttons react to, say, numpad keys, among others. created keydown events of them, works when button key press focused. read keypreview property, exists windows forms, correct? feel need change property of buttongrid
, can't figure out. relatively new programming way.
edit: 1 of methods, how generic method like? onlydigitsintextbox custom method consisting of .appendtext extension method.
private void button6_key(object sender, keyeventargs e) { if (e.key == key.numpad6) { onlydigitsintextbox("6"); } }
Comments
Post a Comment