废话少说,直接看代码。我怎么把数值显示文本框显示到窗体上?一般是用this.controls.add(),这里怎么加?
namespace WindowsApplication1
{
public class csz参赛者类
{
public int x血=0,gj攻击=0,fy防御=0;
private TextBox mzb名字编辑框 = new TextBox();
private TextBox[] szx数值显示文本框 = new TextBox[4];
public csz参赛者类()
{
for (int i = 0; i < szx数值显示文本框.Length; i++)
{
szx数值显示文本框[i] = new TextBox();
szx数值显示文本框[i].ReadOnly = true;
szx数值显示文本框[i].Left = 30;
szx数值显示文本框[i].Top = i * 30 + 20;
}
}
}
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
csz参赛者类 csz参赛者一 = new csz参赛者类();
csz参赛者类 csz参赛者二 = new csz参赛者类();
}
}
}