Public Function AddNewControl(ByVal type As String) As Object Dim oNewControl As Object Dim oNewLabel As New System.Windows.Forms.Label Dim oNewButton As New System.Windows.Forms.Button Dim oNewTextbox As New System.Windows.Forms.TextBox Dim oNewCheckbox As New System.Windows.Forms.CheckBox Dim oNewCombobox As New System.Windows.Forms.ComboBox Select Case type Case "label" Me.List.Add(oNewLabel) HostForm.Controls.Add(oNewLabel) oNewLabel.Tag = Me.Count oNewControl = oNewLabel Case "button" Me.List.Add(oNewButton) HostForm.Controls.Add(oNewButton) oNewButton.Tag = Me.Count oNewControl = oNewButton Case "textbox" Me.List.Add(oNewTextbox) HostForm.Controls.Add(oNewTextbox) oNewTextbox.Tag = Me.Count oNewControl = oNewTextbox Case "checkbox" Me.List.Add(oNewCheckbox) HostForm.Controls.Add(oNewCheckbox) oNewCheckbox.Tag = Me.Count oNewControl = oNewCheckbox Case "combobox" Me.List.Add(oNewCombobox) HostForm.Controls.Add(oNewCombobox) oNewCombobox.Tag = Me.Count oNewControl = oNewCombobox End Select Return oNewControl End Function