这有可能吗。我在下面粘贴代码,希望任何人都可以向我展示正确的方法。
For Each tbbox As TableLayoutPanel In GroupBox3.Controls
'looping through all controls in my tablelayoutpanle
For Each ctl As Control In tbbox.Controls
If ctl.Name.StartsWith("cb_barva") Then
'im stuck here...
With (ctl)
.DataSource = ds_barve.Tables("moje_barve")
.DisplayMember = "barva"
.ValueMember = "barva"
.SelectedIndex = 0
End With
End If
Next
Next