打印

[NET精华教程] .net教程:dotnet中定制自己的表格

.net教程:dotnet中定制自己的表格

下列程序达到如下功能:
1、在表格中增加一个下拉菜单;
2、在表格中增加一个选择菜单;

3、可以自己定制菜单的背景颜色;

在你的page_load 事件中加入如下代码:

dropdownlist dropdownlst = new dropdownlist();
tablerow row = new tablerow();
dropdownlst.items.add("item1");
dropdownlst.items.add("item2");
dropdownlst.items.add("item3");
dropdownlst.items.add("item4");
dropdownlst.items.add("item5");
dropdownlst.backcolor = system.drawing.color.red;
tablecell cell = new tablecell();
cell.controls.add(dropdownlst);
row.cells.add(cell);
row.backcolor = system.drawing.color.green;
table1.rows.add(row);


checkbox checkbox1 = new checkbox();
checkbox1.checked = true;
checkbox1.backcolor = system.drawing.color.yellow;
tablecell cell2 = new tablecell();
cell2.controls.add(checkbox1);
row.cells.add(cel






TOP

返回顶部
AYBlue

Processed in 0.039668 second(s), 7 queries.

当前时区 GMT+8, 现在时间是 2009-1-8 15:48 京ICP备06054220号

清除 Cookies - 联系我们 - 163K.com - Archiver - WAP