Having trouble accessing a MDI Parent from a child when using a cast.
Posted on 2006-06-06
I am designing a tabbed web browser using C# and have run into a few problems. If anyone out there can help I would be much obliged!
My problem is accessing common fields on the MDI Parent from the child. Basically I want to update the address bar (and other fields) on the MDI Parent when the child form's "webbrowser.navigated" event fires. The code I am using is...
private void webMainBrowser_Navigated(object sender, WebBrowserNavigatedEventArgs e)
frmMain MainForm = (frmMain)this.MdiParent;
MainForm.cmbAddress.Text = this.webMainBrowser.Url.ToString();
There are no errors being thrown up in my code but nothing is happening either! Help!
PS Hate to state the obvious but I am a newbie!