Public Class MyCombobox Dim db As New clsDB Dim m_sql As String Property Dataselection As String Get Return m_sql End Get Set(value As String) m_sql = value End Set End Property Dim M_TableAlias As String = "" Property TableAlias As String Get Return M_TableAlias End Get Set(value As String) M_TableAlias = value End Set End Property Dim m_table As String Property Table As String Get Return m_table End Get Set(value As String) m_table = value db.dsDaten.Tables.Clear() Try Dim TableFound As Boolean = False For Each t As DataTable In IntTables.Inttables.Tables If Me.TableAlias <> "" Then If t.TableName = Me.TableAlias Then TableFound = True Else If t.TableName = value Then TableFound = True End If Next If Not TableFound Then If Me.Dataselection <> "" Then db.Get_Tabledata(value, " ", Me.Dataselection) Else db.Get_Tabledata(value, " where aktiv=1") End If If Me.TableAlias <> "" Then db.dsDaten.Tables(0).TableName = Me.TableAlias Else db.dsDaten.Tables(0).TableName = value End If IntTables.Inttables.Tables.Add(db.dsDaten.Tables(0).Copy) End If If Me.TableAlias <> "" Then Me.combobox1.DataSource = IntTables.Inttables.Tables(Me.TableAlias) Else Me.combobox1.DataSource = IntTables.Inttables.Tables(value) End If Catch ex As Exception End Try End Set End Property Dim m_displaymember As String Property Displaymember As String Get Return m_displaymember End Get Set(value As String) m_displaymember = value Me.combobox1.DisplayMember = m_displaymember End Set End Property Dim m_valuememeber As String Property Valuemember As String Get Return m_valuememeber End Get Set(value As String) m_valuememeber = value Me.combobox1.ValueMember = m_valuememeber End Set End Property Dim m_selectedvalue As String Property SelectedValue Get m_selectedvalue = Me.combobox1.SelectedValue Return m_selectedvalue End Get Set(value) m_selectedvalue = value Me.combobox1.SelectedValue = value End Set End Property Dim m_text As String Property Text As String Get m_text = Me.combobox1.Text Return m_text End Get Set(value As String) m_text = value Me.combobox1.Text = value End Set End Property End Class