回覆列表
  • 1 # 陽光魯寧

    將被呼叫的窗體加個timer, 並將其Modifiers屬性改為public, 寫下如下程式碼:

    public partial class Form2 : Form

    {

    public Form2()

    {

    InitializeComponent();

    }

    private void button1_Click(object sender, EventArgs e)

    {

    }

    private void timer1_Tick(object sender, EventArgs e)

    {

    button1_Click(this, null);

    timer1.Enabled = false;

    }

    }

    呼叫窗體寫下以下程式碼即可:

    private void button1_Click(object sender, EventArgs e)

    {

    Form2 f = new Form2();

    f.timer1.Enabled = true;

    }

  • 中秋節和大豐收的關聯?
  • c語言中,char a?