Search code examples
c#winformsevent-handlingform-load

Form1_Load not firing even after adding handler


It's been a long time since I've dabbled with C#, but I'm having a heck of a time getting my form_load to fire. This is the most simple thing I can't imagine why it won't fire! Any assistance would be appreciated.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace AppName_v4._0___TestRoom_Addon{
    public partial class Form1 : Form{

        public Form1() {
            InitializeComponent();
            this.Load += new EventHandler(this.Form1_Load); //FIRES!
        }

        private void Form1_Load(object sender, EventArgs e) {
            webKitBrowser1.Dock = DockStyle.Fill; //DOES NOT FIRE!
            webKitBrowser1.Navigate("http://192.168.0.10/?zoneid=11");
        }
    }
}

UPDATE

  • I have used breakpoints to verify the line is not hit
  • The form does show Screenshot of resulting Form

I have also tried the following with no success:

namespace AlphaEntry_v4._0___MailRoom_Addon{
    public partial class Form1 : Form{

        public Form1() {
            InitializeComponent();

        }

        protected override void OnLoad(EventArgs e)
        {
            webKitBrowser1.Dock = DockStyle.Fill;
            webKitBrowser1.Navigate("http://192.168.0.10/?zoneid=11");

            base.OnLoad(e);
        }
    }
}

UPDATE #2 I was able to get this working by removing and re-adding the references to the WebKit Control. Not sure what happened. Thanks everyone.


Solution

  • I was able to get this working by removing and re-adding the references to the WebKit Control. Not sure what happened, but the comment by John Arlen steered me in the right direction. Thanks everyone.