只要把控件NetMenu添加到当前控件列表就可以:this.Controls.Add(NetMenu);
解决方案 »
- 怎么把毫秒变成秒
- DataGridView与数据库问题
- 谁有好的生成条码的DLL啊,仍一个过来呗,谢谢
- DataView DataGrid DataTable 到底哪个有AddNew的事件啊?
- 为什么,何时(好处)要用抽象类,接口,以及他们使用上不仅仅是语法上的区别?
- 怎么样利用无穷级数逼近计算无理数
- 哪位大虾分析一下public,internal,private,protected,protected internal的区别,谢谢
- StreamWriter 操作小问题。
- 求helpProvider.SetHelpKeyword的使用方法,外部帮助文件为html help workshop 3.0
- 请给一个比较完整的例子,如何从Sql Server中取出图片,显示在PictureBox控件中。
- 高手帮忙啊
- Hashtable中 如何根据它VALUE得值到KEY值?
//---------------------------------------
//1、重写WebControl的CreateChildControls方法:protected override void CreateChildControls()
{
Controls.Clear();
ClearChildViewState();
BuildControlHierarchy();
}//2、BuildControlHierarchy的实现
private void BuildControlHierarchy()
{
// 建一个2行4列的表格
Table t = new Table();
t.ID="t";
t.Font.Name = this.Font.Name;
t.Font.Size = this.Font.Size;
t.BorderStyle = this.BorderStyle;
t.BorderWidth = this.BorderWidth;
t.BorderColor = this.BorderColor;
t.Width = this.Width;
t.Height = this.Height;
t.BackColor = this.BackColor;
t.ForeColor = this.ForeColor;
//表格行变量
TableRow row;
//单元格变量
TableCell cell; // 添加一个表格行(第1行)--------------
row = new TableRow();
row.VerticalAlign=VerticalAlign.Top;
row.Width=this.Width;
cell = new TableCell();
LinkButton lnbtnDelete = new LinkButton();
lnbtnDelete.Text = "删除"; cell.Controls.Add(lnbtnDelete); row.Cells.Add(cell);
t.Rows.Add(row); // 把表格加入控件
this.Controls.Add(t);
}