如何在运行时创建文本框? [英] How to Create text box in Runtime?

查看:83
本文介绍了如何在运行时创建文本框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在运行时创建文本框(与用户一样多)并使用这些文本框添加值并执行不同的操作?谢谢:)

How can i create text Box in runtime ( as many as the user wants ) & use those text box to add values & perform diffrent operations? Thank You :)

推荐答案

试试这个链接:



点击我! [ ^ ]



这应该为您提供一些可以提供帮助的资源。

首先尝试研究问题,我们不是您的解决方案提供商。尝试自己解决,然后在遇到代码实际问题时再回来。不是只需要解决方案。
Try this link:

Click Me![^]

This should provide you with some resources that can help.
Try researching the problem first, we are not your solution provider. Attempt to solve it yourself and then come back when you have actual issues with the code. Not when you just want a solution.


private void Form1_Load(object sender, EventArgs e)
       {
           this.textBox1 = new System.Windows.Forms.TextBox();

           //
           // textBox1
           //
           this.textBox1.BackColor = System.Drawing.SystemColors.ScrollBar;
           this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
           this.textBox1.Location = new System.Drawing.Point(29, 46);
           this.textBox1.Name = "textBox1";
           this.textBox1.Size = new System.Drawing.Size(100, 21);
           this.textBox1.TabIndex = 0;
           this.textBox1.Text = "txtBoxRunTime";
           this.Controls.Add(textBox1);
       }


查看我以前的答案:在VB.Net中处理动态按钮和文本框 [ ^ ]
See my past answer: Handling Dynamic Button and Textbox in VB.Net[^]


这篇关于如何在运行时创建文本框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆