在vb.net中的tabcontrol上填充多个组合框

时间:2018-04-30 19:06:36

标签: vb.net combobox tabs tabcontrol

我在Tabcontrol的多个页面上填充多个组合框,而这种方法适用于表单上的组合框,它不适用于填充TabControl上的组合框

For Each tab_page As Control In Me.TabControl1.TabPages
    For Each temp_ctrl As Control In tab_page.Controls
        If temp_ctrl.GetType.ToString = "System.Windows.Forms.ComboBox" Then
            temp_cmb = CType(Me.Controls(temp_ctrl.Name), ComboBox)
            For Each r As DataRow In dtab_KPI.Rows
                temp_cmb.Items.Add(r(0))
            Next
        End If
    Next
Next

0 个答案:

没有答案