RichTextBox updated to RICHEDIT50W

This commit is contained in:
Alexander 2019-11-19 15:44:18 +02:00
parent e14f35b51e
commit 9776aaf3e9

View file

@ -35,6 +35,19 @@ protected override void WndProc(ref Message m)
base.WndProc(ref m);
}
[DllImport("kernel32.dll", EntryPoint = "LoadLibraryW",
CharSet = CharSet.Unicode, SetLastError = true)]
private static extern IntPtr LoadLibraryW(string s_File);
protected override CreateParams CreateParams
{
get
{
var cp = base.CreateParams;
LoadLibraryW("MsftEdit.dll");
cp.ClassName = "RichEdit50W";
return cp;
}
}
protected override void OnHandleCreated(EventArgs e)
{
@ -44,8 +57,9 @@ protected override void OnHandleCreated(EventArgs e)
AutoWordSelection = true;
AutoWordSelection = false;
}
}
}
}
public static class RichTextBoxPadding
{
public static void SetInnerMargins(this TextBoxBase textBox, int left, int top, int right, int bottom)
@ -117,6 +131,5 @@ public static void ResumeDrawing(this RichTextBox richTextBox)
richTextBox.Invalidate();
}
}
}