[WinForms] ComboBox, ListBox and TextBox should use Control Foreground+Background
authorMarek Habersack <grendel@twistedcode.net>
Fri, 16 Oct 2015 19:39:29 +0000 (21:39 +0200)
committerMarek Habersack <grendel@twistedcode.net>
Fri, 16 Oct 2015 19:41:26 +0000 (21:41 +0200)
They have been using Window Foreground+Background so far which make them unreadable
on systms with dark themes. This change makes them behave.

mcs/class/System.Windows.Forms/System.Windows.Forms/ComboBox.cs
mcs/class/System.Windows.Forms/System.Windows.Forms/ListBox.cs
mcs/class/System.Windows.Forms/System.Windows.Forms/TextBox.cs

index fad6981b745964226a9ff363374068cfde4946ef..58a6f94bd3e379dee860bc20f70b290f9fbf051f 100644 (file)
@@ -98,7 +98,7 @@ namespace System.Windows.Forms
                        items = new ObjectCollection (this);
                        DropDownStyle = ComboBoxStyle.DropDown;
                        item_height = FontHeight + 2;
-                       background_color = ThemeEngine.Current.ColorWindow;
+                       background_color = ThemeEngine.Current.ColorControl;
                        border_style = BorderStyle.None;
 
                        drop_down_height = default_drop_down_height;
index d7f84766858b6967ab5655ab36a5071ac57a86cd..538e9e5ead36ae2bac7737565d2db39dfea73a4b 100644 (file)
@@ -102,7 +102,7 @@ namespace System.Windows.Forms
 
                        requested_height = bounds.Height;
                        InternalBorderStyle = BorderStyle.Fixed3D;
-                       BackColor = ThemeEngine.Current.ColorWindow;
+                       BackColor = ThemeEngine.Current.ColorControl;
 
                        /* Vertical scrollbar */
                        vscrollbar = new ImplicitVScrollBar ();
index d7c548ca0a2aa00a52e785e6e8ff86c1fcaeb61c..bbf7778ce7c98985320c04386f43c7e2418c5ad0 100644 (file)
@@ -69,8 +69,8 @@ namespace System.Windows.Forms {
                        this.RightToLeftChanged += new EventHandler (TextBox_RightToLeftChanged);
                        MouseWheel += new MouseEventHandler (TextBox_MouseWheel);
 
-                       BackColor = SystemColors.Window;
-                       ForeColor = SystemColors.WindowText;
+                       BackColor = ThemeEngine.Current.ColorControl;
+                       ForeColor = ThemeEngine.Current.ColorControlText;
                        backcolor_set = false;
 
                        SetStyle (ControlStyles.StandardClick | ControlStyles.StandardDoubleClick, false);