Thanks for the response Jacob but I'm still having a problem. Here's a better example of where I'm going wrong. I have an MDI application with three forms:-
MDIMain.cs
Browser.cs - (Contains the axWebBrowser object)
ButtonsForm.cs
axWebBrowser is instanciated in the Browser.cs form. Browser.cs also includes this public function:-
public void redirectWeb(string sUrl)
{
try
{
axWebBrowser1.Visible = true;
axWebBrowser1.BringToFront();
System.Object nullObject = 0;
System.Object nullObjStr = "";
Cursor.Current = Cursors.WaitCursor;
axWebBrowser1.Focus();
axWebBrowser1.Navigate(sUrl, ref nullObject, ref nullObjStr, ref nullObjStr, ref nullObjStr);
Cursor.Current = Cursors.Default;
}
catch(Exception exc)
{
MessageBox.Show(exc.Message);
}
}
When I press a button on the ButtonPanel.cs form I would like it to pass a new URL to the current instance of the axWebBrowser control but I'm not sure how to do this. I can get the application to create a new instance of the Browser.cs form each time I click a button but that is not what I want - I need to pass the URL to the [u]current</u> instance of the axWebBrowser.
I'm probably approaching this completely wrong but I need guidance.
Many thanks,
Phil
|