JJ_12_11
This commit is contained in:
@@ -789,33 +789,35 @@ Public Class ClassControlBuilder
|
||||
End If
|
||||
|
||||
'SQL-Command vorhanden also Ausführen des SQL
|
||||
If sqlcommand.Length > 1 Then
|
||||
Dim DT_Combobox As DataTable = ClassDatabase.Return_Datatable(sqlcommand)
|
||||
If DT_Combobox Is Nothing = False Then
|
||||
If DT_Combobox.Rows.Count > 0 Then
|
||||
control.DataSource = DT_Combobox
|
||||
control.DisplayMember = DT_Combobox.Columns(1).ColumnName
|
||||
control.ValueMember = DT_Combobox.Columns(0).ColumnName
|
||||
control.AutoCompleteMode = AutoCompleteMode.SuggestAppend
|
||||
control.AutoCompleteSource = AutoCompleteSource.ListItems
|
||||
End If
|
||||
Dim iWidestWidth As Integer = 300
|
||||
For Each row As DataRow In DT_Combobox.Rows
|
||||
'Die BReite der DropDown-Lsit anpassen
|
||||
Using g As Graphics = control.CreateGraphics
|
||||
If g.MeasureString(row.Item(1).ToString, control.Font).Width + 30 > iWidestWidth Then
|
||||
iWidestWidth = g.MeasureString(row.Item(1).ToString, control.Font).Width + 30
|
||||
End If
|
||||
g.Dispose()
|
||||
End Using
|
||||
' control.Items.Add(row.Item(0).ToString)
|
||||
Next
|
||||
If iWidestWidth > 300 Then
|
||||
control.DropDownWidth = Math.Max(iWidestWidth, control.Width)
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
' TODO: ERST LADEN WENN EDIT MODE ENABLEDs
|
||||
'If sqlcommand.Length > 1 Then
|
||||
' Dim DT_Combobox As DataTable = ClassDatabase.Return_Datatable(sqlcommand)
|
||||
' If DT_Combobox Is Nothing = False Then
|
||||
' If DT_Combobox.Rows.Count > 0 Then
|
||||
' control.DataSource = DT_Combobox
|
||||
' control.DisplayMember = DT_Combobox.Columns(1).ColumnName
|
||||
' control.ValueMember = DT_Combobox.Columns(0).ColumnName
|
||||
' control.AutoCompleteMode = AutoCompleteMode.SuggestAppend
|
||||
' control.AutoCompleteSource = AutoCompleteSource.ListItems
|
||||
' End If
|
||||
' Dim iWidestWidth As Integer = 300
|
||||
' For Each row As DataRow In DT_Combobox.Rows
|
||||
' 'Die BReite der DropDown-Lsit anpassen
|
||||
' Using g As Graphics = control.CreateGraphics
|
||||
' If g.MeasureString(row.Item(1).ToString, control.Font).Width + 30 > iWidestWidth Then
|
||||
' iWidestWidth = g.MeasureString(row.Item(1).ToString, control.Font).Width + 30
|
||||
' End If
|
||||
' g.Dispose()
|
||||
' End Using
|
||||
' ' control.Items.Add(row.Item(0).ToString)
|
||||
' Next
|
||||
' If iWidestWidth > 300 Then
|
||||
' control.DropDownWidth = Math.Max(iWidestWidth, control.Width)
|
||||
' End If
|
||||
|
||||
' End If
|
||||
'End If
|
||||
|
||||
' Wenn statische liste vorhanden, werte splitten und einfügen
|
||||
If static_list.Length > 0 Then
|
||||
|
||||
Reference in New Issue
Block a user