i m试图在Visual C 中生成一个随机数生成器,除了重置按钮
外,其他所有内容似乎都起作用Pragma End Region
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;
}
这是我将代码放在重置按钮中的代码。
将button1_click
代码放在MyForm_Load
函数之外,然后肯定会起作用!