G
Guest
I am creating a user control containing a combobox using VB.NET(2003)
I want to add 2 public properties "DataSource" and "Items" like the
"System.Windows.Forms.ComboBox"
here is my code, but it doesn't work. What's wrong with it?
Public Property cboDataSource() As Object
Get
Return Me.cbo.DataSource 'cbo is my combobox
End Get
Set(ByVal Value As Object)
Me.cbo.DataSource = Value
End Set
End Property
Public Property cboItems() As System.Windows.Forms.ComboBox.ObjectCollection
Get
Return Me.cbo.Items
End Get
Set(ByVal Value As System.Windows.Forms.ComboBox.ObjectCollection)
Me.cbo.Items.Add(Value)
End Set
End Property
I want to add 2 public properties "DataSource" and "Items" like the
"System.Windows.Forms.ComboBox"
here is my code, but it doesn't work. What's wrong with it?
Public Property cboDataSource() As Object
Get
Return Me.cbo.DataSource 'cbo is my combobox
End Get
Set(ByVal Value As Object)
Me.cbo.DataSource = Value
End Set
End Property
Public Property cboItems() As System.Windows.Forms.ComboBox.ObjectCollection
Get
Return Me.cbo.Items
End Get
Set(ByVal Value As System.Windows.Forms.ComboBox.ObjectCollection)
Me.cbo.Items.Add(Value)
End Set
End Property