如何解决随机字符串形式数组 - Windows Forms c++ Visual Studio
我希望,当我运行程序时,我创建的每个按钮(以后的按钮会更多)都具有来自数组的随机字符串文本,我已经对其进行了初始化。我不知道我应该做什么。语言是c++。
我的数组如下所示:
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
/// <summary>
/// Summary for MyForm
/// </summary>
public ref class MyForm : public System::Windows::Forms::Form
{
public:
MyForm(void)
{
InitializeComponent();
//
//Todo: Add the constructor code here
//
//KPoP Idols ARRAY Initializing
KPoP_Idols = gcnew array<String^> {"Rose","Yuna","Momo","Irene","ChungHa","Winter","IU"};
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~MyForm()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::Label^ Timer;
private: System::Windows::Forms::Timer^ ShowButtonTextTimer;
private: System::Windows::Forms::Button^ button2;
//KPoP Idols array Declaration
array<String^>^ KPoP_Idols;
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。