(I'm new to C#, so I'm still learning some of the techniques and differences compared to VB.)
I'm developing a windows application in C#. I have a 'parent' form with several text fields. Some of the fields have lookups (via a button) so that a user can lookup a pre-defined value.
The lookup button opens a lookup window with a listview, and the user can select a single value. That single value should be returned back to the parent window.
Unfortunately, due to a bug in an integration framework that I'm having to use, I am unable to open the lookup as a modal window. It MUST be opened as a non-modal window. Because of this, I can't use standard simple techniques of setting a property on the lookup window and having the parent read it after it closes (which works great with a modal window).
I'm thinking instead that I will have the lookup window set a property on the parent window to pass the value back before it is closed. I've got the property coded on the parent, but here is my question / problem:
How do I reference the 'parent' form from the lookup window? i.e. how can the lookup window set the properties of the parent window?
Do I need to have the parent instantiate the lookup window in a particular manner? Is there some simple method by which the lookup window can reference and set the property of the parent window?
Or must I use delegates to pass the value back to the parent, as if it were a sibling window, as described here: (see "Sibling to Sibling")