在Windows窗体中的CheckedListbox中选择单个或多个项目时自动生成标签和文本框 [英] Auto generate labels and textboxes when single or multiple items are selected in CheckedListbox in a windows form
本文介绍了在Windows窗体中的CheckedListbox中选择单个或多个项目时自动生成标签和文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Windows窗体中的CheckedListbox中选择单个或多个项目时,动态自动生成标签和文本框。标签必须包含所选项目的文本。
Auto generate labels and textboxes dynamically when single or multiple items are selected in CheckedListbox in a windows form.Labels must contain the text of selected items.
推荐答案
您好
您可以在运行时创建任何控件,并从父控件添加与表单(此)相同,例如:
Hi
You can create any control at run time and add from parent control same as form(this) for example:
Label label = new Label()
{
Name = "lblTest",
Size = new Size(100, 20),
ForeColor = Color.Black,
Location = new Point(50, 50),
Text = "Test"
};
this.Controls.Add(label);
获取更多信息请关注链接:
向Windows窗体添加控件
在运行时向Windows窗体添加控件
最好的问候。
for getting more information please follow of links:
Adding Controls to Windows Forms
Adding Controls to Windows Forms at Runtime
Best Regards.
这篇关于在Windows窗体中的CheckedListbox中选择单个或多个项目时自动生成标签和文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文