我试图在visual C ++中生成一个随机数生成器,除了重置按钮外,一切似乎都在工作
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;
}
这是我放入重置按钮的代码。
答案 0 :(得分:0)
将button1_click
代码放在MyForm_Load
函数之外,然后它肯定会有效!