我正在可视化C++中生成随机数生成器,但重置按钮不起作用



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函数之外,然后肯定会起作用!

最新更新