From fdc2c6ffe74c2de09baf660c95434da7976b7b3e Mon Sep 17 00:00:00 2001 From: Brandon Desjarlais Date: Fri, 5 Jan 2024 00:10:01 -0600 Subject: [PATCH] - adding fix for #96 --- Scintilla.NET/Scintilla.NET.csproj | 8 ++++---- Shared/Scintilla.cs | 12 ++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Scintilla.NET/Scintilla.NET.csproj b/Scintilla.NET/Scintilla.NET.csproj index 1b85113..1387183 100644 --- a/Scintilla.NET/Scintilla.NET.csproj +++ b/Scintilla.NET/Scintilla.NET.csproj @@ -8,7 +8,7 @@ en-US Source Editing Component based on Scintilla 5 series. Copyright (c) 2018, Jacob Slusser. All rights reserved. VPKSoft, cyber960 2022, desjarlais 2023. - 5.3.3.12 + 5.3.3.14 true bin\$(Configuration)\ScintillaNET.xml true @@ -27,12 +27,12 @@ Scintilla5.NET MIT - https://github.com/desjarlais/ScintillaNET - https://github.com/desjarlais/ScintillaNET + https://github.com/desjarlais/Scintilla.NET + https://github.com/desjarlais/Scintilla.NET vpksoft_logo.png git ScintillaNET Scintilla Editor - Please visit https://github.com/desjarlais/ScintillaNET/releases to view the release notes. + Please visit https://github.com/desjarlais/Scintilla.NET/releases to view the release notes. true true true diff --git a/Shared/Scintilla.cs b/Shared/Scintilla.cs index 98b583e..97bc707 100644 --- a/Shared/Scintilla.cs +++ b/Shared/Scintilla.cs @@ -1404,6 +1404,17 @@ private void InitDocument(Eol eolMode = Eol.CrLf, bool useTabs = false, int tabW DirectMessage(NativeMethods.SCI_SETINDENT, new IntPtr(indentWidth)); } + /// + /// Default Attributes values do not always get applied to the control. + /// https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.defaultvalueattribute?view=net-8.0&redirectedfrom=MSDN + /// "A DefaultValueAttribute will not cause a member to be automatically initialized with the attribute's value. You must set the initial value in your code." + /// This function is created to be called in the OnHandleCreated event so that we can force the default values to be applied. + /// + private void InitControlProps() + { + CaretLineBackColor = Color.Yellow; + } + /// /// Inserts text at the specified position. /// @@ -1761,6 +1772,7 @@ protected override unsafe void OnHandleCreated(EventArgs e) { // Set more intelligent defaults... InitDocument(); + InitControlProps(); // I would like to see all of my text please DirectMessage(NativeMethods.SCI_SETSCROLLWIDTH, new IntPtr(1));