c# - How to effect change from child to parent window -


this simple question, have had no luck researching far. have child window has yes , no button on it. when click no check box become unchecked in parent window (which main window of program).

is there anyway like?:

//no button private void no_click(object sender, routedeventargs e) {     nameofparent.checkbox.checked = false; } 

i've seen this question not think addresses problem.

what correct way go this?

i've been using open other windows:

parent window - current code:

//open new window private void checkbox5_checked(object sender, routedeventargs e) {        var newwindow = new childwindow();        newwindow.button_no.click += buttonno_click;        newwindow.show(); }  //unchecks checkbox 5 private void buttonno_click(object sender, routedeventargs e) {     checkbox5.ischecked = false; } 

opening child window parent window:

private void button_click_1(object sender, routedeventargs e)     {         var window = new childwindow();         window.buttonno.click += buttonno_click;         window.show();     } 

in code of parent window, include click event child window's no button:

    private void buttonno_click(object sender, routedeventargs e)     {         //code uncheck checkbox goes here     } 

this turned out simpler solution windows forms i've been using...and appears work in windows forms well.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -