自从我涉足 C# 以来已经有很长一段时间了,但我有一段时间form_load
要开火了。这是最简单的事情,我无法想象为什么它不会火!任何援助将不胜感激。
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");
}
}
}
更新
- 我已经使用断点来验证该行没有被命中
- 表格确实显示
我也尝试了以下但没有成功:
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);
}
}
}
更新#2我能够通过删除和重新添加对 WebKit 控件的引用来完成这项工作。不知道发生了什么。感谢大家。