如何在C+&#x2B中创建文本框数组。有网络框架?

发布于 2025-01-22 06:41:29 字数 107 浏览 2 评论 0原文

我正在在C ++中开发Wordle,并且正在使用Net Graphic框架,我创建了30个文本框,使用拖放接口,但是要使我的程序工作,我需要将它们放在容器中,例如数组,例如数组,我应该用什么来创建它?

I'm developing Wordle in C++ and I'm using the NET graphic framework, I have created 30 textBoxes with the drag and drop interface but in order to make my program work I need to put them in a container, such as an array, what should I use to create it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

债姬 2025-01-29 06:41:29

尝试如下所示。
详细信息作为评论。

//DECLARE SOME TEXTBOXES
TextBox^ textBox1 = gcnew TextBox();
textBox1->Text = "TextBox1";

TextBox^ textBox2 = gcnew TextBox();
textBox2->Text = "TextBox2";

TextBox^ textBox3 = gcnew TextBox();
textBox3->Text = "TextBox3";

//DECLARE AN ARRAY FOR HOLDING TEXTBOXES
array<TextBox^>^ arrayOfTextBoxes = gcnew array<TextBox^>(3);

arrayOfTextBoxes[0] = textBox1;
arrayOfTextBoxes[1] = textBox2;
arrayOfTextBoxes[2] = textBox3;

//TEST
for (int i = 0; i < 3; i++)
     Console::WriteLine(arrayOfTextBoxes[i]->Text);
    

Try as shown below.
Details as comments.

//DECLARE SOME TEXTBOXES
TextBox^ textBox1 = gcnew TextBox();
textBox1->Text = "TextBox1";

TextBox^ textBox2 = gcnew TextBox();
textBox2->Text = "TextBox2";

TextBox^ textBox3 = gcnew TextBox();
textBox3->Text = "TextBox3";

//DECLARE AN ARRAY FOR HOLDING TEXTBOXES
array<TextBox^>^ arrayOfTextBoxes = gcnew array<TextBox^>(3);

arrayOfTextBoxes[0] = textBox1;
arrayOfTextBoxes[1] = textBox2;
arrayOfTextBoxes[2] = textBox3;

//TEST
for (int i = 0; i < 3; i++)
     Console::WriteLine(arrayOfTextBoxes[i]->Text);
    
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文