动态生成并显示某一控件
ywcyj 2004-10-09 07:19:42 在后台写代码生成某一控件,定义它在界面上显示的各类参数,让它在界面上显示出来
这种效果能做到吗?该如何实现?不能是界面上隐藏的控件,呵呵
我试着初始化一个textBox,但编译都过不去
System.Windows.Forms.TextBox textBox2 =new System.Windows.Forms.TextBox();
textBox2.Location.X=32;
textBox2.Location.Y=100;
textBox2.Size.Width=100;
textBox2.Size.Height=21;
textBox2.Visible=true;
错误信息:
E:\code\zxjg\WindowsApplication1\Form1.cs(91): 无法修改“System.Windows.Forms.Control.Location”的返回值,因为它不是变量
E:\code\zxjg\WindowsApplication1\Form1.cs(93): 无法修改“System.Windows.Forms.Control.Size”的返回值,因为它不是变量