在表单元格中添加两个控件不起作用

时间:2017-12-29 15:13:26

标签: asp.net vb.net code-behind

您好我正在尝试将两个控件添加到代码位于下方的表格单元格中。不幸的是,超链接总是在表格单元格之外,而标签在里面。个别地他们工作得很好,但一起不太好,有人可以帮助我。

Dim iCell As New TableCell

Dim lbl As New Label
lbl.Height = Unit.Pixel(100)
lbl.Width = Unit.Pixel(150)
lbl.Style.Add("padding", "5px")
lbl.Style.Add("border-radius", "10px")
lbl.BorderStyle = BorderStyle.Solid
lbl.BorderWidth = Unit.Pixel(1)
lbl.BorderColor = Color.Black

lbl.Font.Size = 9
lbl.Text = "Event: " & dt.Rows(y).Item("eventname")    
lbl.BackColor = ColorTranslator.FromHtml(dt.Rows(y).Item("roomcolor"))

Dim hyp As New HyperLink
hyp.Font.Size = 9
hyp.Text = "Modify"
hyp.NavigateUrl = "modify.aspx"

iCell.Controls.Add(lbl)
iCell.Controls.Add(hyp)

iCell.VerticalAlign = VerticalAlign.Top
tRow.Cells.Add(iCell)

0 个答案:

没有答案