3
我需要在vb.net中動態創建圖像控件。在聲明new image(dim img as New Image()
它顯示以下錯誤:vb.net中的動態圖像控制
Error: New cannot be used in a class that is MustInherit
有沒有解決方案?這是我需要使用它:
Dim imgBox As New Image()
imgBox.ImageUrl = "~/Images/" & strImgName
Dim tr As New TableRow
Dim tdRight As New TableCell
Dim tdLeft As New TableCell
tdRight.Controls.Add(imgBox)
tdLeft.Controls.Add(imgBox)
tr.Controls.Add(tdLeft) 'adding left cell
tr.Controls.Add(tdRight) 'adding right cell
tb.Controls.Add(tr)
感謝Guffa它曾與昏暗imgBox作爲新WebControls.Image() – Suchith