You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

131 lines
3.5 KiB

Public Class MyCombobox
Inherits ComboBox
Dim db As New clsDB
Dim tbl As New DataTable
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
tbl = IntTables.Inttables.Tables(Me.TableAlias).Copy
MyBase.DataSource = tbl
'MyBase.DataSource = IntTables.Inttables.Tables(Me.TableAlias)
Else
tbl = IntTables.Inttables.Tables(value).Copy
MyBase.DataSource = tbl
'MyBase.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
MyBase.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
Try
MyBase.ValueMember = m_valuememeber
Catch
End Try
End Set
End Property
Dim m_selectedvalue As String
Property SelectedValue
Get
m_selectedvalue = MyBase.SelectedValue
Return m_selectedvalue
End Get
Set(value)
Try
m_selectedvalue = value
Catch
m_selectedvalue = -1
End Try
MyBase.SelectedValue = value
End Set
End Property
Dim m_text As String
Property Text As String
Get
m_text = MyBase.Text
Return m_text
End Get
Set(value As String)
m_text = value
MyBase.Text = value
End Set
End Property
End Class