如何创建动态标签 [英] How to create dynamic label

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

问题描述

如何根据数据库表的值创建动态标签.它将检查到列的最后一个单元格并在下一行为每个单元格的值创建标签?

How to create dynamic label according to database table''s value.It will check till last cell of column and create lable for each cell''s value in next line?

推荐答案

您好,

使用此代码
Hi,

use this code
Label label = new Label();
label.Text = "The Text";
PlaceHolder1.Controls.Add(label);


您可以像其他任何控件一样动态创建标签
You can create a label like any other control dynamically
System.Windows.Forms.Label newLabel = new System.Windows.Forms.Label()

,然后设置其LocationSizeText属性,最后将其添加到其父级的Controls集合中. br/>
但是您也可以使用某种网格来显示表格数据.

Then set its Location, Size and Text properties and finally add it to its parent''s Controls collection.

But you could as well use some sort of grid to display tabular data.


这篇关于如何创建动态标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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