This is a common mistake. Basically, for an event handler, theres two parts - method(s) (or function(s)) that are called when the event is 'fired', and something to tell the control what functions will handle which events. You've got the first part, a function, but you have nothing telling it that the function will handle an event.
Think of it like this - the control is like a police chief. In his station are a bunch of functions (his police officers) that would do a good job at handling any event (such as a bank robbery). But when an event takes palce, the police chief has to actually know which police officers he can tell to go and handle it.
Simply naming a function WebBrowser_Navigate isn't enough for it to be picked up as the Navigate event handler for the WebBrowser control - just as a policeman named PoliceStation_BankRobbery wouldn't necessarily mean he was the best man to handle a bank robbery.
Usually, when you use the designer to add an event handler, it does this stuff behind the scenes. If you look in the bit of code you posted:
Code:
//
// WebBrowser
//
this.WebBrowser.Anchor = System.Windows.Forms.AnchorStyles.None;
this.WebBrowser.Enabled = true;
this.WebBrowser.Location = new System.Drawing.Point(-8, 72);
this.WebBrowser.OcxState = ((System.Windows.Forms.AxHost.State)(resources.Get Object("WebBrowser.OcxState")));
this.WebBrowser.Size = new System.Drawing.Size(1288, 784);
this.WebBrowser.TabIndex = 5;
This code was generated by Visual Studio for you, because typing this stuff in yourself would be long, boring and a waste of time, especially with positioning.
What it also would have had, is something like this:
Code:
//
// WebBrowser
//
this.WebBrowser.Anchor = System.Windows.Forms.AnchorStyles.None;
this.WebBrowser.Enabled = true;
this.WebBrowser.Location = new System.Drawing.Point(-8, 72);
this.WebBrowser.OcxState = ((System.Windows.Forms.AxHost.State)(resources.Get Object("WebBrowser.OcxState")));
this.WebBrowser.Navigate += new EventHandler(WebBrowser_Navigate);
this.WebBrowser.Size = new System.Drawing.Size(1288, 784);
this.WebBrowser.TabIndex = 5;
This line of code says "The function WebBrowser_Navigate will handle the 'Navigate' event when fired by the WebBrowser control".
Keep in mind it may not be 'new EventHandler', but rather something like new WebBrowserEventHandler' or something like that. If you simply type:
this.WebBrowser.Navigate +=
Visual Studio should just attempt to add it for you with some cool intellisense stuff, and you can just press Tab to let it do it's job.