c# - Fire RadioButton checked routed event programmatically -
is there anyway raise radiobutton
checked routed event code, in order handle in parent control?
this situation:
var radio = new radiobutton(); radio.ischecked = true; radio.raiseevent(new routedeventargs(radiobutton.checkedevent));
the third line not work.
googling, found way based on radiobuttonautomationpeer
, had not found way make work.
does have hint?
thanks in advance.
var radio = new radiobutton(); radio.checkedchanged +=new eventhandler(radio_checkedchanged); radio.ischecked = true; private void radio_checkedchanged(object sender, eventargs e) { if (radio.checked) { messagebox.show("true"); } else { messagebox.show("false"); } }
Comments
Post a Comment