路过的高手一定要过来看看!帮帮忙!
public Form1(){
public class Form1 : System.Windows.Forms.Form
{
protected System.Windows.Forms.Button button1;
protected System.Windows.Forms.Button button2;
public Form1()
{
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
private void InitializeComponent()
{
}
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Load(object sender, System.EventArgs e)
{
}
public void ss()
{MessageBox.Show("试验");
}
public virtual void button1_Click(object sender, System.EventArgs e)
{
ss();
}
private void button2_Click(object sender, System.EventArgs e)
{
Form2 ee=new Form2();
ee.ShowDialog();
}
}
}
public class Form2 : WindowsApplication1.Form1
public override void button1_Click(object sender, System.EventArgs e)
{
base.button1_Click( sender, e);
}
private void button2_Click(object sender, System.EventArgs e)
{
}
private void Form2_Load(object sender, System.EventArgs e)
{
}
}
}
为什么在form2中点击button1的时候会有两次“试验”的对话框出现呢?