我在Visual C ++中生成一个随机数生成器,重置按钮不起作用

时间:2016-06-23 09:32:34

标签: visual-studio-2013 c++-cli

我试图在visual C ++中生成一个随机数生成器,除了重置按钮外,一切似乎都在工作

pragma endregion

private: System::Void MyForm_Load(System::Object^  sender, System::EventArgs^  e) {
             // Reset button
             System::Void button1_Click(System::Object^  sender, System::EventArgs^  e)
                 ; {

             // clear label fields
             this->label1->Text = "0";
             this->label2->Text = "0";
             this->label3->Text = "0";
             this->label4->Text = "0";
             this->label5->Text = "0";
             this->label6->Text = "0";
             this->label7->Text = "0";

             // set button state
             this->button1->Enabled = false;
             this->button2->Enabled = true;
}

这是我放入重置按钮的代码。

1 个答案:

答案 0 :(得分:0)

button1_click代码放在MyForm_Load函数之外,然后它肯定会有效!