В смысле добавить объекты? ПРограммно, чтобы при загрузке формы добавлялись объекты эти? А сразу нарисовать их не проще? Вы же добавляете дефолтные объекты.
А вообще, вот цитата с MSDN
Цитата:
The following code example adds two Control objects to the Control..::.ControlCollection of the derived class Panel. The example requires that you have created a Panel control and a Button control on a Form. When the button is clicked, two RadioButton controls are added to the panel's Control..::.ControlCollection.
Visual Basic Copy Code
' Create two RadioButtons to add to the Panel.
Dim RadioAddButton As RadioButton = New RadioButton()
Dim RadioAddRangeButton As RadioButton = New RadioButton()
' Add controls to the Panel using the AddRange method.
Private Sub AddRangeButton_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles AddRangeButton.Click
' Set the Text the RadioButtons will display.
RadioAddButton.Text = "RadioAddButton"
RadioAddRangeButton.Text = "RadioAddRangeButton"
' Set the appropriate location of RadioAddRangeButton.
RadioAddRangeButton.Location = New System.Drawing.Point( _
RadioAddButton.Location.X, _
RadioAddButton.Location.Y + RadioAddButton.Height)
' Add the controls to the Panel.
Panel1.Controls.AddRange(New Control() {RadioAddButton, RadioAddRangeButton})
End Sub
|
ДОбавляют 2 элемента, НО: объявляют их как Dim RadioAddButton As RadioButton = New RadioButton() и потом задают им свойства. Без этого, скорее всего, они не добавятся.