jj 05.10 fix overwriting font color for controls in OnEnabledChanged

This commit is contained in:
JenneJ
2016-10-05 16:25:17 +02:00
parent e16e64a77c
commit e07dab0857

View File

@@ -129,22 +129,23 @@ Public Class ClassControlBuilder
Private Sub OnEnabledChanged(sender As Object, e As EventArgs)
Dim control As Control = DirectCast(sender, Control)
' FIXME: Hier wird die konfigurierte Farbe überschrrieben, brauchen wird das? o.O
' 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.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
'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
@@ -872,7 +873,7 @@ Public Class ClassControlBuilder
Select Case type
Case "Label"
Dim label As Label = CType(control, Label)
AddHandler label.EnabledChanged, AddressOf OnEnabledChanged
'AddHandler label.EnabledChanged, AddressOf OnEnabledChanged
Case "TextBox"
Dim textbox As TextBox = CType(control, TextBox)
@@ -890,33 +891,33 @@ Public Class ClassControlBuilder
'AddHandler combo.TextChanged, AddressOf RecordChanged
'AddHandler combo.GotFocus, AddressOf OnComboBoxFocus
'AddHandler combo.LostFocus, AddressOf OnComboBoxLostFocus
AddHandler combo.EnabledChanged, AddressOf OnEnabledChanged
'AddHandler combo.EnabledChanged, AddressOf OnEnabledChanged
Case "RadioButton"
Dim radiobutton As RadioButton = CType(control, RadioButton)
AddHandler radiobutton.CheckedChanged, AddressOf RecordChanged
AddHandler radiobutton.EnabledChanged, AddressOf OnEnabledChanged
'AddHandler radiobutton.EnabledChanged, AddressOf OnEnabledChanged
Case "CheckBox"
Dim checkbox As CheckBox = CType(control, CheckBox)
AddHandler checkbox.CheckedChanged, AddressOf RecordChanged
AddHandler checkbox.EnabledChanged, AddressOf OnEnabledChanged
'AddHandler checkbox.EnabledChanged, AddressOf OnEnabledChanged
AddHandler checkbox.CheckedChanged, AddressOf CheckBoxChanged
Case "PictureBox"
Dim picturebox As PictureBox = CType(control, PictureBox)
AddHandler picturebox.BackgroundImageChanged, AddressOf RecordChanged
AddHandler picturebox.EnabledChanged, AddressOf OnEnabledChanged
'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.DateTimeChanged, AddressOf OnDateTimeValueChanged
AddHandler datetimepick.EnabledChanged, AddressOf OnEnabledChanged
'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
'AddHandler listbox.EnabledChanged, AddressOf OnEnabledChanged
Case "CheckedListBoxControl"
Dim chklistbox As DevExpress.XtraEditors.CheckedListBoxControl = CType(control, DevExpress.XtraEditors.CheckedListBoxControl)
@@ -929,7 +930,7 @@ Public Class ClassControlBuilder
AddHandler gridview.RowsAdded, AddressOf RecordChanged
AddHandler gridview.CellValueChanged, AddressOf RecordChanged
AddHandler gridview.RowsRemoved, AddressOf RecordChanged
AddHandler gridview.EnabledChanged, AddressOf OnEnabledChanged
'AddHandler gridview.EnabledChanged, AddressOf OnEnabledChanged
Case "GridControl"
Dim gridcontrol As DevExpress.XtraGrid.GridControl = CType(control, DevExpress.XtraGrid.GridControl)
Dim gridview As DevExpress.XtraGrid.Views.Grid.GridView = gridcontrol.MainView