Ranorex.Form newForm = Ranorex.Host.Local.FindSingle<Ranorex.Form>(new RxPath("/form[@"automationid='myForm']"), new Duration(duration)); // I want to close any forms that may be opened from the main form newForm.Children[0].Close()
Close a child form from a parent
Close a child form from a parent
Is it possible to close a child form from the parent object? For example, under the parent from there is a child form object. I want to call a .Close() on that child form but am not able to. The only way I have been able to close that form is to find it by itself and then i can call .Close() on it. I want to get the parent and close any child forms that might be opened.
Re: Close a child form from a parent
Hello !
Would this work :
Swiss'
Would this work :
Form father = myrepo.myform.Self; Form child = father.Children[0]; child.Close();Regards
Swiss'
A simple thank you always does wonders !
Re: Close a child form from a parent
Thanks, that did the trick! Defining the child as a form (Form child = father.Children[0]) is just what it needed.
I appreciate the quick response,
Jared
I appreciate the quick response,
Jared