我的代码:
Rs.Open("Select * From Notifications",Con)
If Not Rs.EOF Then
For i=0 to Rs.RecordCount -1
Dim Label As New Label
With Label
.Name = String.Format("Label_{0}",Rs("Id").Value.ToString)
.Text = Rs("Notification").Value.ToString
End With
If Not Panel.Controls.Contains(Label) Then
Panel.Control.Add(Label)
End If
Rs.MoveNext()
Next
End If
但这总是将控制添加到面板,以下代码行未正确执行:
(If Not Panel.Controls.Contains(Label) Then)
此代码适用于计时器。