只是个简单的内容,请多多指教.
//文本框(TextBox)
TextBox txtBox = new TextBox();
txtBox.Location = new System.Drawing.Point(6, 8);
txtBox.Name = "txt" + tabPateName;
SetTextBindingInfo(txtBox, tabPateName);
txtBox.Size = new System.Drawing.Size(340, 21);
txtBox.ReadOnly = true;
txtBox.TextChanged += new System.EventHandler(txtBox_TextChanged);
//选择框(CheckedListBox)
CheckedListBox clbBox = new CheckedListBox();
clbBox.FormattingEnabled = true;
clbBox.Location = new System.Drawing.Point(3, 35);
clbBox.Name = "clb" + tabPateName;
clbBox.Size = new System.Drawing.Size(349, 212);
//添加事件
clbBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(clbBox_
C#中程序中自动添加控件
最新推荐文章于 2023-02-23 09:35:20 发布
这篇博客介绍了如何在C#程序中动态添加文本框(TextBox)和选择框(CheckedListBox)控件。通过实例代码展示了它们的定位、大小设置、事件绑定等操作,为用户界面动态生成提供参考。
摘要由CSDN通过智能技术生成