Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Название темы: Visual Basic 2008
Показать сообщение отдельно

Аватара для Delirium

Ветеран


Сообщения: 5624
Благодарности: 936

Профиль | Отправить PM | Цитировать


В смысле добавить объекты? ПРограммно, чтобы при загрузке формы добавлялись объекты эти? А сразу нарисовать их не проще? Вы же добавляете дефолтные объекты.
А вообще, вот цитата с 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() и потом задают им свойства. Без этого, скорее всего, они не добавятся.

-------

Пройденные курсы:
[Microsoft №10174 Sharepoint], [SharePoint]
Мои проекты:[CheckAdmins], [NetSend7], [System Uptime], [Remote RAdmin LogViewer],[Netdom GDI], [Holidays - напоминалка о днях рождения]

А я офис-гуру :)

Это сообщение посчитали полезным следующие участники:

Отправлено: 01:34, 27-08-2008 | #251

Название темы: Visual Basic 2008