Updating Parent Frame

yogiwales

Newcomer
Joined
Jan 23, 2003
Messages
21
Location
Cardiff, Wales - UK
I can pass data to a sibling frame from the parent by creating a public property in the sibling and setting it from the parent. After changing information in the new frame and saving it I want the parent window to update itself to show the information amended.

How can i do this? as i cant create an instance of the parent as it already exists, and i cant use that instance as it doesnt exist in the sibling frame.

Thanks
Yogi
 
I have always had to use the parents Activated event handler. What I did was I had a static variable specifically for that certain purpose and I put it in the Activated event checking if it changed or not.

While in the owned form (sibling) I set that static variable to a certain value that Activated in the parent will check for. If it changed then I would have a sub I call to update the form and set the static variable back to where it was.

Then for the form to update you need to Focus() or Select() the parent form. Use Owner.Select()

I hope you know what I mean. And don't forget, when you create the child form set it's owner property to the parent form.
 
Use a static variable:
public static int x = 0; - must always be initialized when declared.

To access a static variable from another class just type the name of the class the variable is in followed by a . and then the variable name.
Form1.x = 7;

I don't know VB well enouph to be sure how to write those examples but they are almost the same.
 
Back
Top