I'm working on a .FF editor for PS3 MW2 patch_mp.ff's, My design is entirely dark themed, and everything works fine but one thing; numbers appear black on black background within an ICSharpCode.TextEditor.TextEditorControl, I've never seen one post of anyone else with this problem online, so have no way to find a method to troubleshoot it.

What I have tried:

Syntax Highlighting Strategy Methods External Syntax Highlighing Via XSHD file Setting All SystemColors used to Color.White And So on..

Here is how I am creating my TextEditorControl:

        private TextEditorControl AddNewTextEditor(string title)
        {
            tab = new TabPage(title);
            tab.ForeColor = Color.White;
            TextEditorControl textEditorControl = new TextEditorControl();
            textEditorControl.ForeColor = Color.White;
            textEditorControl.Dock = DockStyle.Fill;
            textEditorControl.IsReadOnly = false;
            textEditorControl.ContextMenuStrip = contextMenuStrip2;
            textEditorControl.Text = readgsc;
            TextEditorControl Editor = textEditorControl;
            Font font = new Font("Consolas", 9f);
            if (font.Name == "Consolas")
                Editor.Font = font;
            Editor.ForeColor = Color.White;
            Editor.SetHighlighting("GSC");
            Editor.BorderStyle = BorderStyle.FixedSingle;
            Editor.EnableFolding = true;
            Editor.ShowVRuler = false;
            Editor.Document.FormattingStrategy = new FormattingStrategy();
            Editor.Document.FoldingManager.FoldingStrategy = new MyFolding();
            Editor.IndentStyle = IndentStyle.Smart;
            Editor.Document.DocumentChanged += (sender, e) => SetModifiedFlag(Editor, true);
            Editor.TextChanged += new EventHandler(FileHasBeenEdited);

            //BackColor Is Color.Black\\
            HighlightColor highlightColor = new HighlightColor(Color.White, BackColor, false, false);

            DefaultHighlightingStrategy highlightingStrategy = Editor.Document.HighlightingStrategy as DefaultHighlightingStrategy;
            highlightingStrategy.SetColorFor("Default", highlightColor);
            highlightingStrategy.SetColorFor("LineNumbers", highlightColor);
            highlightingStrategy.SetColorFor("FoldLine", highlightColor);
            highlightingStrategy.SetColorFor("Digits", highlightColor);

            tab.Enter += delegate (object sender, EventArgs e)
            {
                TabPage tabPage = (TabPage)sender;
                //tabPage.BeginInvoke(new Action<TabPage>(delegate (TabPage p) {p.Controls[0].Focus();}), new object[]
                //{
                //    tabPage
                //});
            };
            tab.Controls.Add(Editor);
            //fileTabs is a TabControl With No Tabs Until Added Programatticaly\\
            fileTabs.Controls.Add(tab);
            fileTabs.SelectedTab = tab;
            if (_editorSettings == null)
            {
                _editorSettings = Editor.TextEditorProperties;
                OnSettingsChanged();
            }
            else
                Editor.TextEditorProperties = _editorSettings;
            return Editor;
        }

What I need as a result:

Numbers I can read on a black theme.

PLEASE NOTE: This issue is due to the system setting the color, this issue only happens on OS' before Windows 10. (Ones that set 90% of text to black)

If there is a way to change SystemColors.ControlText to another color forcefully, that would likely work.

Screenshot Of The Issue: Black Numbers

1 Answers

0
Ben Yousaf On Best Solutions

Answer: Adding: <Digits name = "Digits" bold = "false" italic = "false" color = "White"/> to my syntax highlighting file, combined with my highlightingstrategy, then setting anything you want white to: Color.FromArgb(255, 255, 255); That should override any system colors.

If anyone else with this issue needs help, hmu on Discord via http://discord.me/Poppy