I am using Visual Studio 2005 and vb.net.
I have several comboboxes on a form. Each combobox needs to be filled with a list of items from a single datasource. Each list will consist of item descriptions from a different set of records from the datasource. I have accomplished this with a small subroutine. However, each combobox has to have its own subroutine because I have to use the name of the combobox. For example, this is the vb.net code I'm using to add an item to the combobox.
Me.ComboBox1.Items.Add(ItemDescription)
Is there some way to use Me.Controls.Item(ComboBoxName) to add the items? This way I could pass the name of the control to the subroutine and have all the comboboxes filled using just one subroutine. Or is there another way of doing this?
Thanks.
I have several comboboxes on a form. Each combobox needs to be filled with a list of items from a single datasource. Each list will consist of item descriptions from a different set of records from the datasource. I have accomplished this with a small subroutine. However, each combobox has to have its own subroutine because I have to use the name of the combobox. For example, this is the vb.net code I'm using to add an item to the combobox.
Me.ComboBox1.Items.Add(ItemDescription)
Is there some way to use Me.Controls.Item(ComboBoxName) to add the items? This way I could pass the name of the control to the subroutine and have all the comboboxes filled using just one subroutine. Or is there another way of doing this?
Thanks.