Where Can I Find Key Events in LightSwitch? -
i'm working on project in lightswitch , i'm trying handle keyup event on specific screen
i couldn't find it, can find events (such keyup keydown lostfocus ext. )
and if not supported should handle situation that?
i guess referring controls , not actual screen. so, example, handle keyboard events on textbox, 1 way of achieving in example, have "address1" textbox , want change text whenever user types letter:
1 - on activated event of screen, can required textbox:
partial void customerslistdetail_activated() { this.findcontrol("address1").controlavailable += addresstextboxavailable; }
2 - on available event handler, can connect required event (you can have keyup, keydown, lostfocus , others):
private void addresstextboxavailable(object sender, controlavailableeventargs e) { ((system.windows.controls.textbox) e.control).keyup += addresstextboxkeyup; }
3 - on keyup event handler, can manipulation:
private void addresstextboxkeyup(object sender, keyeventargs e) { if (e.key == key.a) { ((system.windows.controls.textbox) sender).text = "you typed a"; } }
Comments
Post a Comment