Form2窗体代码如下:
namespace WindowsFormsApplication24
{
public partial class Form2 : WindowsFormsApplication24.Form1
{
public override void msg()
{
textBox1.Text = "继承的窗体实例";
base.msg();
}
public Form2()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
}
private void Form2_Load(object sender, EventArgs e)
{
msg();
}
}
}
可是运行Form2窗体时textBox1依然显示“机窗体”