Hi. The title of the question says it all really. I have a child form which has a find form in it. I set the find form's owner to the child form like so:
private void ShowFindForm()
{
FindForm.Show(this);
}
which then allows me to access it's properties like this:
private void FindNext()
{
TreeNode matchingNode = ...
... etc
... etc
OwnerForm form = this.Owner as OwnerForm;
form.TreeView.SelectedNode = matchingNode;
}
This works perfectly fine until I shove the owner form into an MDI form, whereby the MDI form promptly takes ownership of the find form and messes it all up. How do I get around this?
UPDATE:
I can hack around this by iterating through the MDI form's MdiChildren property until I find the form I want, but this seems a bit cowboy-ish.