diff --git a/app/DD-Record-Organiser/ClassControlBuilder.vb b/app/DD-Record-Organiser/ClassControlBuilder.vb
index a3f35fd..055da56 100644
--- a/app/DD-Record-Organiser/ClassControlBuilder.vb
+++ b/app/DD-Record-Organiser/ClassControlBuilder.vb
@@ -82,6 +82,40 @@ Public Class ClassControlBuilder
End If
End Sub
+ Private Sub OnEnabledChanged(sender As Object, e As EventArgs)
+ Dim control As Control = DirectCast(sender, Control)
+
+ ' Checkbox, radiobutton, label ist sonderfall
+ If control.GetType() = GetType(CheckBox) Or _
+ control.GetType() = GetType(RadioButton) Or _
+ control.GetType() = GetType(Label) Then
+ ' Hier wird nur die vordergrund-farbe geändert
+ control.ForeColor = Color.Black
+ Exit Sub
+ End If
+
+ If control.Enabled Then
+ control.BackColor = Color.White
+ control.ForeColor = Color.Black
+ ElseIf control.Enabled = False Then
+ control.BackColor = System.Drawing.SystemColors.Info
+ control.ForeColor = Color.Black 'System.Drawing.SystemColors.InfoText
+ End If
+ End Sub
+
+ ' Wie OnEnabledChanged, nur für TextBVi
+ Private Sub OnReadOnlyChanged(sender As Object, e As EventArgs)
+ Dim control As TextBox = DirectCast(sender, TextBox)
+
+ If control.ReadOnly = False Then
+ control.BackColor = Color.White
+ control.ForeColor = Color.Black
+ ElseIf control.ReadOnly = True Then
+ control.BackColor = System.Drawing.SystemColors.Info
+ control.ForeColor = Color.Black 'System.Drawing.SystemColors.InfoText
+ End If
+ End Sub
+
Public Sub OnTextBoxFocus(sender As Object, ByVal e As EventArgs)
Dim box As TextBox = sender
box.BackColor = Color.LemonChiffon
@@ -96,11 +130,11 @@ Public Class ClassControlBuilder
End Sub
Public Sub OnComboBoxFocus(sender As Object, ByVal e As EventArgs)
- Dim combo As ComboBox = sender
+ Dim combo As CustomComboBox = sender
combo.BackColor = Color.LemonChiffon
End Sub
Public Sub OnComboBoxLostFocus(sender As Object, ByVal e As EventArgs)
- Dim combo As ComboBox = sender
+ Dim combo As CustomComboBox = sender
combo.BackColor = Color.White
End Sub
Dim CONTROL_ID
@@ -114,11 +148,11 @@ Public Class ClassControlBuilder
Dim value
Select Case control.GetType()
- Case GetType(ComboBox)
- If IsNothing(DirectCast(control, ComboBox).ValueMember) Then
- value = DirectCast(control, ComboBox).Text
+ Case GetType(CustomComboBox)
+ If IsNothing(DirectCast(control, CustomComboBox).ValueMember) Then
+ value = DirectCast(control, CustomComboBox).Text
Else
- value = DirectCast(control, ComboBox).SelectedValue
+ value = DirectCast(control, CustomComboBox).SelectedValue
End If
Case Else
Exit Sub
@@ -158,11 +192,11 @@ Public Class ClassControlBuilder
Dim dt As DataTable = ClassDatabase.Return_Datatable(sqlcommand)
Dim obj
obj = dependingControl.GetType.ToString
- Select Case dependingControl.GetType.ToString
+ Select Case dependingControl.GetType().Name
- Case "System.Windows.Forms.ComboBox"
- ControlLoader.Combobox.SetDataSource(DirectCast(dependingControl, ComboBox), dt)
- Case "System.Windows.Forms.Label"
+ Case "ComboBox"
+ ControlLoader.Combobox.SetDataSource(DirectCast(dependingControl, CustomComboBox), dt)
+ Case "Label"
If dt.Rows.Count = 1 Then
Try
ControlLoader.Label.LoadValue(DirectCast(dependingControl, Label), 9999, 9999, dt.Rows(0).Item(0).ToString, True)
@@ -170,7 +204,7 @@ Public Class ClassControlBuilder
ClassLogger.Add(ex.Message)
End Try
End If
- Case "System.Windows.Forms.TextBox"
+ Case "TextBox"
If dt.Rows.Count = 1 Then
Try
Dim value1 As String = dt.Rows(0).Item(0)
@@ -227,7 +261,7 @@ Public Class ClassControlBuilder
' Dim dependingControlId As Integer = datatable.Rows(0).Item("GUID")
' Dim panel As Panel = DirectCast(control.Parent, Panel)
' ' Über die Id das Control finden
- ' Dim dependingControl As ComboBox = panel.Controls.OfType(Of ComboBox)().Where(Function(c As ComboBox)
+ ' Dim dependingControl As CustomComboBox = panel.Controls.OfType(Of CustomComboBox)().Where(Function(c As CustomComboBox)
' Return DirectCast(c.Tag, ClassControlMetadata).Id = dependingControlId
' End Function).SingleOrDefault()
@@ -266,43 +300,64 @@ Public Class ClassControlBuilder
AddHandler control.MouseHover, AddressOf MouseHover
Select Case type
+ Case "Label"
+ Dim label As Label = CType(control, Label)
+ AddHandler label.EnabledChanged, AddressOf OnEnabledChanged
+
Case "TextBox"
Dim textbox As TextBox = CType(control, TextBox)
AddHandler textbox.TextChanged, AddressOf RecordChanged
AddHandler textbox.GotFocus, AddressOf OnTextBoxFocus
AddHandler textbox.LostFocus, AddressOf OnTextBoxLostFocus
AddHandler textbox.TextChanged, AddressOf OnTextBoxTextChanged
+ AddHandler textbox.ReadOnlyChanged, AddressOf OnReadOnlyChanged
Case "ComboBox"
- Dim combo As ComboBox = CType(control, ComboBox)
+ Dim combo As CustomComboBox = CType(control, CustomComboBox)
AddHandler combo.SelectedValueChanged, AddressOf RecordChanged
AddHandler combo.SelectedValueChanged, AddressOf OnComboBoxValueChanged
AddHandler combo.TextChanged, AddressOf RecordChanged
- AddHandler combo.GotFocus, AddressOf OnComboBoxFocus
- AddHandler combo.LostFocus, AddressOf OnComboBoxLostFocus
+ 'AddHandler combo.GotFocus, AddressOf OnComboBoxFocus
+ 'AddHandler combo.LostFocus, AddressOf OnComboBoxLostFocus
+ AddHandler combo.EnabledChanged, AddressOf OnEnabledChanged
+
Case "RadioButton"
Dim radiobutton As RadioButton = CType(control, RadioButton)
AddHandler radiobutton.CheckedChanged, AddressOf RecordChanged
+ AddHandler radiobutton.EnabledChanged, AddressOf OnEnabledChanged
+
Case "CheckBox"
Dim checkbox As CheckBox = CType(control, CheckBox)
AddHandler checkbox.CheckedChanged, AddressOf RecordChanged
+ AddHandler checkbox.EnabledChanged, AddressOf OnEnabledChanged
+
Case "PictureBox"
Dim picturebox As PictureBox = CType(control, PictureBox)
AddHandler picturebox.BackgroundImageChanged, AddressOf RecordChanged
+ AddHandler picturebox.EnabledChanged, AddressOf OnEnabledChanged
+
Case "DateEdit"
Dim datetimepick As DevExpress.XtraEditors.DateEdit = CType(control, DevExpress.XtraEditors.DateEdit)
AddHandler datetimepick.DateTimeChanged, AddressOf RecordChanged
+ AddHandler datetimepick.EnabledChanged, AddressOf OnEnabledChanged
+
Case "ListBoxControl"
Dim listbox As DevExpress.XtraEditors.ListBoxControl = CType(control, DevExpress.XtraEditors.ListBoxControl)
AddHandler listbox.SelectedValueChanged, AddressOf RecordChanged
+ AddHandler listbox.EnabledChanged, AddressOf OnEnabledChanged
+
Case "CheckedListBoxControl"
Dim chklistbox As DevExpress.XtraEditors.CheckedListBoxControl = CType(control, DevExpress.XtraEditors.CheckedListBoxControl)
AddHandler chklistbox.ItemCheck, AddressOf RecordChanged
+ AddHandler chklistbox.EnabledChanged, AddressOf OnEnabledChanged
+
Case "DataGridView"
Dim gridview As DataGridView = CType(control, DataGridView)
AddHandler gridview.RowsAdded, AddressOf RecordChanged
AddHandler gridview.CellValueChanged, AddressOf RecordChanged
AddHandler gridview.RowsRemoved, AddressOf RecordChanged
+ AddHandler gridview.EnabledChanged, AddressOf OnEnabledChanged
+
End Select
End Sub
@@ -479,7 +534,7 @@ Public Class ClassControlBuilder
End If
End Sub
- Private Sub AddComboHandler(control As ComboBox, format As String)
+ Private Sub AddComboHandler(control As CustomComboBox, format As String)
If format = "Currency" Then
AddHandler control.Leave, AddressOf Combo_Currency_Handler
ElseIf format = "Decimal" Then
@@ -509,7 +564,7 @@ Public Class ClassControlBuilder
End Sub
Private Sub Combo_Currency_Handler(sender As Object, e As EventArgs)
- Dim control As ComboBox = DirectCast(sender, ComboBox)
+ Dim control As CustomComboBox = DirectCast(sender, CustomComboBox)
Dim value As Decimal
If Decimal.TryParse(control.Text.Trim(), value) Then
control.Text = value.ToString("c")
@@ -520,7 +575,7 @@ Public Class ClassControlBuilder
End Sub
Private Sub Combo_Decimal_Handler(sender As Object, e As EventArgs)
- Dim control As ComboBox = DirectCast(sender, ComboBox)
+ Dim control As CustomComboBox = DirectCast(sender, CustomComboBox)
Dim value As Decimal
If Decimal.TryParse(control.Text.Trim(), value) Then
control.Text = value.ToString("###,###")
@@ -543,31 +598,32 @@ Public Class ClassControlBuilder
Public Sub SetActiveColor(ActiveControl As Control)
Dim ActiveColor As Color = Color.DarkOrange
- Dim CurrentType As String = ActiveControl.GetType.ToString
+ Dim CurrentType As String = ActiveControl.GetType().Name
Select Case CurrentType
- Case "System.Windows.Forms.TextBox"
+ Case "TextBox"
ActiveControl.BackColor = ActiveColor
- Case "System.Windows.Forms.ComboBox"
+ Case "ComboBox"
+ 'Case "System.Windows.Forms.ComboBox"
ActiveControl.BackColor = ActiveColor
- Case "System.Windows.Forms.Label"
+ Case "Label"
ActiveControl.BackColor = ActiveColor
- Case "System.Windows.Forms.CheckBox"
+ Case "CheckBox"
ActiveControl.BackColor = ActiveColor
- Case "System.Windows.Forms.Button"
+ Case "Button"
ActiveControl.BackColor = ActiveColor
- Case "System.Windows.Forms.DataGridView"
+ Case "DataGridView"
Dim current As DataGridView = DirectCast(ActiveControl, DataGridView)
current.BackgroundColor = ActiveColor
- Case "DevExpress.XtraEditors.DateEdit"
+ Case "DateEdit"
ActiveControl.BackColor = ActiveColor
- Case "System.Window.Forms.GroupBox"
+ Case "GroupBox"
ActiveControl.BackColor = ActiveColor
- Case "System.Windows.Forms.PictureBox"
+ Case "PictureBox"
ActiveControl.BackColor = ActiveColor
- Case "DevExpress.XtraEditors.CheckedListBoxControl"
+ Case "CheckedListBoxControl"
ActiveControl.BackColor = ActiveColor
- Case "DevExpress.XtraEditors.ListBoxControl"
+ Case "ListBoxControl"
ActiveControl.BackColor = ActiveColor
End Select
End Sub
@@ -575,56 +631,58 @@ Public Class ClassControlBuilder
Public Sub ResetActiveColor(ActiveControl As Control)
For Each inctrl As Control In Me._master_panel.Controls
If inctrl.Name <> ActiveControl.Name Then
- Dim Type As String = inctrl.GetType.ToString
+ Dim Type As String = inctrl.GetType().Name
Select Case Type
- Case "System.Windows.Forms.TextBox"
+ Case "TextBox"
inctrl.BackColor = Color.White
- Case "System.Windows.Forms.ComboBox"
+ Case "ComboBox"
+ 'Case "System.Windows.Forms.ComboBox"
inctrl.BackColor = Color.White
- Case "System.Windows.Forms.Label"
+ Case "Label"
inctrl.BackColor = Color.Transparent
- Case "System.Windows.Forms.CheckBox"
+ Case "CheckBox"
inctrl.BackColor = Color.Transparent
- Case "System.Windows.Forms.DataGridView"
+ Case "DataGridView"
Dim ctrl As DataGridView = DirectCast(inctrl, DataGridView)
ctrl.BackgroundColor = SystemColors.ControlDark
- Case "DevExpress.XtraEditors.DateEdit"
+ Case "DateEdit"
inctrl.BackColor = Color.White
- Case "System.Windows.Forms.Button"
+ Case "Button"
inctrl.BackColor = SystemColors.Control
- Case "System.Windows.Forms.GroupBox"
+ Case "GroupBox"
inctrl.BackColor = SystemColors.Control
- Case "DevExpress.XtraEditors.CheckedListBoxControl"
+ Case "CheckedListBoxControl"
inctrl.BackColor = Color.White
- Case "DevExpress.XtraEditors.ListBoxControl"
+ Case "ListBoxControl"
inctrl.BackColor = Color.White
- Case "System.Windows.Forms.PictureBox"
+ Case "PictureBox"
inctrl.BackColor = SystemColors.ControlDark
For Each gbctrl As Control In inctrl.Controls
If gbctrl.Name <> ActiveControl.Name Then
Dim gbType As String = gbctrl.GetType.ToString
Select Case gbType
- Case "System.Windows.Forms.TextBox"
+ Case "TextBox"
gbctrl.BackColor = Color.White
- Case "System.Windows.Forms.ComboBox"
+ Case "ComboBox"
+ 'Case "System.Windows.Forms.ComboBox"
gbctrl.BackColor = Color.White
- Case "System.Windows.Forms.Label"
+ Case "Label"
gbctrl.BackColor = Color.Transparent
- Case "System.Windows.Forms.CheckBox"
+ Case "CheckBox"
gbctrl.BackColor = Color.Transparent
- Case "System.Windows.Forms.DataGridView"
+ Case "DataGridView"
Dim ctrl As DataGridView = DirectCast(gbctrl, DataGridView)
ctrl.BackgroundColor = SystemColors.ControlDark
- Case "DevExpress.XtraEditors.DateEdit"
+ Case "DateEdit"
gbctrl.BackColor = Color.White
- Case "System.Windows.Forms.Button"
+ Case "Button"
gbctrl.BackColor = SystemColors.Control
- Case "System.Windows.Forms.PictureBox"
+ Case "PictureBox"
inctrl.BackColor = SystemColors.ControlDark
- Case "DevExpress.XtraEditors.CheckedListBoxControl"
+ Case "CheckedListBoxControl"
inctrl.BackColor = Color.White
- Case "DevExpress.XtraEditors.ListBoxControl"
+ Case "ListBoxControl"
inctrl.BackColor = Color.White
End Select
End If
@@ -987,7 +1045,9 @@ Public Class ClassControlBuilder
Optional parent As GroupBox = Nothing,
Optional _designMode As Boolean = False)
Try
- Dim control As New ComboBox
+ Dim _control As New ComboBox
+ Dim control As New CustomComboBox
+
Dim defaultSize As Size = New Size(120, 24)
Dim metadata As New ClassControlMetadata()
@@ -1035,7 +1095,7 @@ Public Class ClassControlBuilder
End If
Me.SetEventHandlers(control)
- Me.CurrentControl = DirectCast(control, ComboBox)
+ Me.CurrentControl = DirectCast(control, CustomComboBox)
If Not IsNothing(parent) Then
control.Parent = parent
Me.AddToGroupBox(parent, control)
@@ -1048,7 +1108,7 @@ Public Class ClassControlBuilder
End Try
End Sub
- Public Sub AutoCompleteCombo_KeyUp(ByVal cbo As ComboBox, ByVal e As KeyEventArgs)
+ Public Sub AutoCompleteCombo_KeyUp(ByVal cbo As CustomComboBox, ByVal e As KeyEventArgs)
''Allow select keys without Autocompleting
Select Case e.KeyCode
Case Keys.Back, Keys.Left, Keys.Right, Keys.Up, Keys.Delete, Keys.Down
@@ -1092,7 +1152,7 @@ Public Class ClassControlBuilder
'End If
End Sub
- Public Sub AutoCompleteCombo_Leave(ByVal cbo As ComboBox)
+ Public Sub AutoCompleteCombo_Leave(ByVal cbo As CustomComboBox)
Dim iFoundIndex As Integer
iFoundIndex = cbo.FindStringExact(cbo.Text)
cbo.SelectedIndex = iFoundIndex
diff --git a/app/DD-Record-Organiser/ClassControlCommandsUI.vb b/app/DD-Record-Organiser/ClassControlCommandsUI.vb
index a8fcb95..b7ce6f7 100644
--- a/app/DD-Record-Organiser/ClassControlCommandsUI.vb
+++ b/app/DD-Record-Organiser/ClassControlCommandsUI.vb
@@ -572,8 +572,8 @@ Public Class ClassControlCommandsUI
Case "TextBox"
Return DirectCast(ctrl, TextBox).Text
Case "ComboBox"
- If LogErrorsOnly = False Then ClassLogger.Add(" >> Return Value: " & DirectCast(ctrl, ComboBox).Text, False)
- Return DirectCast(ctrl, ComboBox).Text
+ If LogErrorsOnly = False Then ClassLogger.Add(" >> Return Value: " & DirectCast(ctrl, CustomComboBox).Text, False)
+ Return DirectCast(ctrl, CustomComboBox).Text
Case "CheckBox"
Return DirectCast(ctrl, CheckBox).Checked.ToString()
Case "RadioButton"
diff --git a/app/DD-Record-Organiser/ClassControlLoader.vb b/app/DD-Record-Organiser/ClassControlLoader.vb
index f02d40d..c30f168 100644
--- a/app/DD-Record-Organiser/ClassControlLoader.vb
+++ b/app/DD-Record-Organiser/ClassControlLoader.vb
@@ -107,7 +107,7 @@
End Try
End Function
- Overloads Shared Sub SetDataSource(control As Windows.Forms.ComboBox, dt As DataTable)
+ Overloads Shared Sub SetDataSource(control As CustomComboBox, dt As DataTable)
Dim sw As Stopwatch = Stopwatch.StartNew()
Dim columnCount As Integer = dt.Columns.Count
@@ -296,11 +296,11 @@
Public Class Combobox : Inherits _ListControl
- Public Shared Sub LoadValue(control As Windows.Forms.ComboBox, recordId As Integer, parentRecordId As Integer, value As String)
+ Public Shared Sub LoadValue(control As CustomComboBox, recordId As Integer, parentRecordId As Integer, value As String)
control.Text = value
End Sub
- Public Shared Sub LoadList(control As Windows.Forms.ComboBox, formId As Integer, connID As Object, SQLCommand As String)
+ Public Shared Sub LoadList(control As CustomComboBox, formId As Integer, connID As Object, SQLCommand As String)
Try
Dim dynamic As DynamicValue = GetDynamicValue(DirectCast(control.Tag, ClassControlMetadata).Id, formId, connID, SQLCommand)
@@ -317,7 +317,7 @@
End Try
End Sub
- Private Shared Sub CalculateDropdownWidth(control As Windows.Forms.ComboBox, dt As DataTable)
+ Private Shared Sub CalculateDropdownWidth(control As CustomComboBox, dt As DataTable)
Try
Const WIDEST_WIDTH As Integer = 300
Dim FinalWidth As Integer = WIDEST_WIDTH
diff --git a/app/DD-Record-Organiser/ClassControlValues.vb b/app/DD-Record-Organiser/ClassControlValues.vb
index e7bddb3..511db94 100644
--- a/app/DD-Record-Organiser/ClassControlValues.vb
+++ b/app/DD-Record-Organiser/ClassControlValues.vb
@@ -13,8 +13,8 @@ Public Class ClassControlValues
Return True
End If
- Case GetType(ComboBox)
- Dim combobox As ComboBox = DirectCast(control, ComboBox)
+ Case GetType(CustomComboBox)
+ Dim combobox As CustomComboBox = DirectCast(control, CustomComboBox)
If combobox.Text.Trim() = String.Empty Then
Return False
Else
@@ -218,8 +218,8 @@ Public Class ClassControlValues
Dim label As Label = DirectCast(control, Label)
ControlLoader.Label.LoadValue(label, recordId, parentRecordId, value, entity_ID)
- Case GetType(ComboBox)
- Dim combobox As ComboBox = DirectCast(control, ComboBox)
+ Case GetType(CustomComboBox)
+ Dim combobox As CustomComboBox = DirectCast(control, CustomComboBox)
ControlLoader.Combobox.LoadValue(combobox, recordId, parentRecordId, value)
Case GetType(CheckBox)
@@ -299,8 +299,8 @@ Public Class ClassControlValues
Dim sqlcommand As String = row.Item("SQL")
Dim ConnID = row.Item("CONTROL_CONNID_1")
Select Case Ctrl.GetType()
- Case GetType(ComboBox)
- Dim combobox = DirectCast(Ctrl, ComboBox)
+ Case GetType(CustomComboBox)
+ Dim combobox = DirectCast(Ctrl, CustomComboBox)
ControlLoader.Combobox.LoadList(combobox, FormID, ConnID, sqlcommand)
Case GetType(DevExpress.XtraEditors.ListBoxControl)
@@ -359,8 +359,8 @@ Public Class ClassControlValues
sqlcommand = ReplaceSqlCommandPlaceholders(sqlcommand, RecordId, ParentRecordId, entity_ID)
Select Case Ctrl.GetType()
- Case GetType(ComboBox)
- Dim combobox = DirectCast(Ctrl, ComboBox)
+ Case GetType(CustomComboBox)
+ Dim combobox = DirectCast(Ctrl, CustomComboBox)
ControlLoader.Combobox.LoadList(combobox, FormId, connID, sqlcommand)
Case GetType(DevExpress.XtraEditors.ListBoxControl)
@@ -394,8 +394,8 @@ Public Class ClassControlValues
Public Shared Sub UnloadControlValuesList(RecordID As Integer, FormID As Integer, controls As Control.ControlCollection)
For Each C As Control In controls
- If TypeOf C Is ComboBox Then
- Dim Combobox = DirectCast(C, ComboBox)
+ If TypeOf C Is CustomComboBox Then
+ Dim Combobox = DirectCast(C, CustomComboBox)
Dim currentValue As String = Combobox.Text
Combobox.DataSource = Nothing
Combobox.Text = currentValue
@@ -433,8 +433,8 @@ Public Class ClassControlValues
Case GetType(TextBox)
DirectCast(control, TextBox).Text = String.Empty
- Case GetType(ComboBox)
- Dim combo As ComboBox = DirectCast(control, ComboBox)
+ Case GetType(CustomComboBox)
+ Dim combo As CustomComboBox = DirectCast(control, CustomComboBox)
combo.SelectedIndex = -1
combo.Text = String.Empty
@@ -532,8 +532,8 @@ Public Class ClassControlValues
Dim radio As RadioButton = DirectCast(control, RadioButton)
radio.Checked = StrToBool(autoValue)
- Case GetType(ComboBox)
- Dim combobox As ComboBox = DirectCast(control, ComboBox)
+ Case GetType(CustomComboBox)
+ Dim combobox As CustomComboBox = DirectCast(control, CustomComboBox)
If IsDBNull(autoValue) Then
combobox.SelectedIndex = -1
Else
diff --git a/app/DD-Record-Organiser/ClassCustomComboBox.vb b/app/DD-Record-Organiser/ClassCustomComboBox.vb
new file mode 100644
index 0000000..db30333
--- /dev/null
+++ b/app/DD-Record-Organiser/ClassCustomComboBox.vb
@@ -0,0 +1,51 @@
+Public Class CustomComboBox
+ Inherits Windows.Forms.ComboBox
+
+ Public Sub New()
+ MyBase.New()
+
+ DrawMode = Windows.Forms.DrawMode.OwnerDrawFixed
+ End Sub
+
+ Protected Overrides Sub OnEnabledChanged(e As EventArgs)
+ 'MyBase.OnEnabledChanged(e)
+
+ If Me.Enabled Then
+ Me.DropDownStyle = ComboBoxStyle.DropDown
+ Else
+ Me.DropDownStyle = ComboBoxStyle.DropDownList
+ End If
+ End Sub
+
+ Protected Overrides Sub OnDrawItem(e As DrawItemEventArgs)
+ Dim g As System.Drawing.Graphics = e.Graphics
+ Dim rect As Rectangle = e.Bounds
+
+ If e.Index >= 0 Then
+ Dim label As String = Me.Items(e.Index).ToString()
+
+
+ If e.State = (DrawItemState.Disabled Or DrawItemState.NoAccelerator Or DrawItemState.NoFocusRect Or DrawItemState.ComboBoxEdit) Then
+ ' DISABLED STATE
+ g.FillRectangle(New SolidBrush(System.Drawing.SystemColors.Info), rect)
+ g.DrawString(label, e.Font, Brushes.Black, rect)
+ e.DrawFocusRectangle()
+
+ ElseIf (e.State = (DrawItemState.NoAccelerator Or DrawItemState.NoFocusRect)) Then
+ ' ITEMS NOT IN FOCUS
+ g.FillRectangle(New SolidBrush(Color.White), rect)
+ g.DrawString(label, e.Font, Brushes.Black, rect)
+ e.DrawFocusRectangle()
+
+ Else
+ ' ITEMS IN FOCUS
+ g.FillRectangle(New SolidBrush(System.Drawing.SystemColors.Highlight), rect)
+ g.DrawString(label, e.Font, Brushes.White, rect)
+ e.DrawFocusRectangle()
+
+ End If
+ End If
+
+ g.Dispose()
+ End Sub
+End Class
diff --git a/app/DD-Record-Organiser/DD-Record-Organiser.vbproj b/app/DD-Record-Organiser/DD-Record-Organiser.vbproj
index b1ab323..0a9e375 100644
--- a/app/DD-Record-Organiser/DD-Record-Organiser.vbproj
+++ b/app/DD-Record-Organiser/DD-Record-Organiser.vbproj
@@ -245,6 +245,9 @@
+
+ Component
+
diff --git a/app/DD-Record-Organiser/My Project/licenses.licx b/app/DD-Record-Organiser/My Project/licenses.licx
index bc10fc1..cdf0550 100644
--- a/app/DD-Record-Organiser/My Project/licenses.licx
+++ b/app/DD-Record-Organiser/My Project/licenses.licx
@@ -1,10 +1,11 @@
-DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v15.1, Version=15.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraEditors.CheckEdit, DevExpress.XtraEditors.v15.1, Version=15.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraNavBar.NavBarControl, DevExpress.XtraNavBar.v15.1, Version=15.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraPdfViewer.PdfViewer, DevExpress.XtraPdfViewer.v15.1, Version=15.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v15.1, Version=15.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.DateEdit, DevExpress.XtraEditors.v15.1, Version=15.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraVerticalGrid.VGridControl, DevExpress.XtraVerticalGrid.v15.1, Version=15.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraBars.Docking.DockManager, DevExpress.XtraBars.v15.1, Version=15.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v15.1, Version=15.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraBars.Navigation.TileNavPane, DevExpress.XtraBars.v15.1, Version=15.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v15.1, Version=15.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraVerticalGrid.VGridControl, DevExpress.XtraVerticalGrid.v15.1, Version=15.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.LookUpEdit, DevExpress.XtraEditors.v15.1, Version=15.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraNavBar.NavBarControl, DevExpress.XtraNavBar.v15.1, Version=15.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v15.1, Version=15.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraPdfViewer.PdfViewer, DevExpress.XtraPdfViewer.v15.1, Version=15.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.CheckEdit, DevExpress.XtraEditors.v15.1, Version=15.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraBars.Docking.DockManager, DevExpress.XtraBars.v15.1, Version=15.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
diff --git a/app/DD-Record-Organiser/frmConstructor_Main.resx b/app/DD-Record-Organiser/frmConstructor_Main.resx
index d8c0eaa..f58d442 100644
--- a/app/DD-Record-Organiser/frmConstructor_Main.resx
+++ b/app/DD-Record-Organiser/frmConstructor_Main.resx
@@ -289,7 +289,7 @@
0, 0
- 788, 270
+ 795, 270
0
@@ -361,7 +361,7 @@
0, 0
- 1069, 312
+ 1072, 316
0
@@ -379,7 +379,7 @@
0
- 1069, 312
+ 1072, 316
Detailansicht
@@ -397,7 +397,7 @@
0
- 1071, 340
+ 1078, 347
1
@@ -420,7 +420,7 @@
- 1069, 287
+ 1072, 291
6
@@ -481,7 +481,7 @@
0, 0
- 1069, 25
+ 1072, 25
2
@@ -502,7 +502,7 @@
1
- 1069, 312
+ 1072, 316
windream-Dateien
@@ -933,7 +933,7 @@
2
- 1069, 312
+ 1072, 316
Wiedervorlage
@@ -960,7 +960,7 @@
Cyan
- 1069, 287
+ 1072, 291
0
@@ -984,7 +984,7 @@
0, 25
- 1069, 287
+ 1072, 291
2
@@ -1159,7 +1159,7 @@
0, 0
- 1069, 25
+ 1072, 25
1
@@ -1188,7 +1188,7 @@
- 1069, 312
+ 1072, 316
Positionen
@@ -1367,7 +1367,7 @@
0, 0
- 1071, 25
+ 1078, 25
0
@@ -1472,7 +1472,7 @@
Panel2
- 1083, 365
+ 1083, 372
0
diff --git a/app/DD-Record-Organiser/frmConstructor_Main.vb b/app/DD-Record-Organiser/frmConstructor_Main.vb
index 95afb0e..a4529db 100644
--- a/app/DD-Record-Organiser/frmConstructor_Main.vb
+++ b/app/DD-Record-Organiser/frmConstructor_Main.vb
@@ -1902,66 +1902,67 @@ Public Class frmConstructor_Main
Select Case Control.GetType()
Case GetType(Windows.Forms.GroupBox)
Lock_Record_Controls_Recursive(state, DirectCast(Control, GroupBox).Controls)
-
Case GetType(Windows.Forms.TextBox)
Dim txt As TextBox = CType(Control, TextBox)
txt.ReadOnly = state
+ Case Else
+ Control.Enabled = Not state
- Case GetType(Windows.Forms.CheckBox)
- Dim chk As CheckBox = CType(Control, CheckBox)
- If state = True Then
- chk.Enabled = False
- Else
- chk.Enabled = True
- End If
+ 'Case GetType(Windows.Forms.CheckBox)
+ ' Dim chk As CheckBox = CType(Control, CheckBox)
+ ' If state = True Then
+ ' chk.Enabled = False
+ ' Else
+ ' chk.Enabled = True
+ ' End If
- Case GetType(Windows.Forms.RadioButton)
- Dim rb As RadioButton = CType(Control, RadioButton)
- If state = True Then
- rb.Enabled = False
- Else
- rb.Enabled = True
- End If
+ 'Case GetType(Windows.Forms.RadioButton)
+ ' Dim rb As RadioButton = CType(Control, RadioButton)
+ ' If state = True Then
+ ' rb.Enabled = False
+ ' Else
+ ' rb.Enabled = True
+ ' End If
- Case GetType(Windows.Forms.ComboBox)
- Dim cbobx As System.Windows.Forms.ComboBox = CType(Control, System.Windows.Forms.ComboBox)
- If state = True Then
- cbobx.Enabled = False
- Else
- cbobx.Enabled = True
- End If
+ 'Case GetType(CustomComboBox)
+ ' Dim cbobx As CustomComboBox = CType(Control, CustomComboBox)
+ ' If state = True Then
+ ' cbobx.Enabled = False
+ ' Else
+ ' cbobx.Enabled = True
+ ' End If
- Case GetType(DevExpress.XtraEditors.DateEdit)
- Dim dtp As DevExpress.XtraEditors.DateEdit = CType(Control, DevExpress.XtraEditors.DateEdit)
- If state = True Then
- dtp.Enabled = False
- Else
- dtp.Enabled = True
- End If
+ 'Case GetType(DevExpress.XtraEditors.DateEdit)
+ ' Dim dtp As DevExpress.XtraEditors.DateEdit = CType(Control, DevExpress.XtraEditors.DateEdit)
+ ' If state = True Then
+ ' dtp.Enabled = False
+ ' Else
+ ' dtp.Enabled = True
+ ' End If
- Case GetType(DevExpress.XtraEditors.CheckedListBoxControl)
- Dim chlb As DevExpress.XtraEditors.CheckedListBoxControl = CType(Control, DevExpress.XtraEditors.CheckedListBoxControl)
- If state = True Then
- chlb.Enabled = False
- Else
- chlb.Enabled = True
- End If
+ 'Case GetType(DevExpress.XtraEditors.CheckedListBoxControl)
+ ' Dim chlb As DevExpress.XtraEditors.CheckedListBoxControl = CType(Control, DevExpress.XtraEditors.CheckedListBoxControl)
+ ' If state = True Then
+ ' chlb.Enabled = False
+ ' Else
+ ' chlb.Enabled = True
+ ' End If
- Case GetType(DevExpress.XtraEditors.ListBoxControl)
- Dim lb As DevExpress.XtraEditors.ListBoxControl = CType(Control, DevExpress.XtraEditors.ListBoxControl)
- If state = True Then
- lb.Enabled = False
- Else
- lb.Enabled = True
- End If
+ 'Case GetType(DevExpress.XtraEditors.ListBoxControl)
+ ' Dim lb As DevExpress.XtraEditors.ListBoxControl = CType(Control, DevExpress.XtraEditors.ListBoxControl)
+ ' If state = True Then
+ ' lb.Enabled = False
+ ' Else
+ ' lb.Enabled = True
+ ' End If
- Case GetType(Windows.Forms.Button)
- Dim btn As Button = CType(Control, Button)
- If state = True Then
- btn.Enabled = False
- Else
- btn.Enabled = True
- End If
+ 'Case GetType(Windows.Forms.Button)
+ ' Dim btn As Button = CType(Control, Button)
+ ' If state = True Then
+ ' btn.Enabled = False
+ ' Else
+ ' btn.Enabled = True
+ ' End If
End Select
Next
End Sub
diff --git a/app/DD-Record-Organiser/frmSQLEditor.vb b/app/DD-Record-Organiser/frmSQLEditor.vb
index cf73e4d..c821dea 100644
--- a/app/DD-Record-Organiser/frmSQLEditor.vb
+++ b/app/DD-Record-Organiser/frmSQLEditor.vb
@@ -197,7 +197,7 @@ Public Class frmSQLEditor
EnableTables()
End Sub
- Private Sub GetColumns(tableName As String, ByRef combobox As ComboBox)
+ Private Sub GetColumns(tableName As String, ByRef combobox As CustomComboBox)
Try
Dim CS As String
CS = ClassDatabase.GetConnectionString(cmbConnection.SelectedValue)