Comments (11)
Is it something that can be tested with MFC? That would isolate it, wouldn't it?
from winforms.
@Nora-Zhou01 Interesting! I was not able to reproduce it with .NET Framework 4.5.2 (our current target framework version), but did not try it with .NET Framework 4.8 tho.
It looks like the bug was introduced between .NET Framework 4.5.2 and 4.8.
Also I was able to reproduce the bug with an last letter of "a" and a initial width of 292.
from winforms.
@merriemcgaw @elachlan @SteffenSchwaiger we can add below quirk in App.config file to disable richedit30.dll for RichTextBox control when project target to .NET Framework 4.8 or 4.8.1.
<runtime>
<AppContextSwitchOverrides value="Switch.System.Windows.Forms.DoNotLoadLatestRichEditControl=true"/>
</runtime>
In .NET Project, we can create a new RichTextBox2 class to use the richedit20.dll version. Like below code snippet:
public class RichTextBox2 : RichTextBox
{
protected override CreateParams CreateParams
{
get
{
if (moduleHandle == IntPtr.Zero)
{
moduleHandle = LoadLibrary("Riched20.dll");
if ((long)moduleHandle < 0x20) throw new Win32Exception(Marshal.GetLastWin32Error(), "Could not load Riched20.dll");
}
var cp = base.CreateParams;
cp.ClassName = "RichEdit20W";
return cp;
}
}
private static IntPtr moduleHandle;
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
static extern IntPtr LoadLibrary(string lpFileName);
}
from winforms.
Excellent bug report! Thank your for the image diff.
@Olina-Zhang can your team please test this?
from winforms.
This issue is reproduced in both .NET framework4.8.1 projects and .NET Core projects, if there is a rendering, it will disappear after adjusting the size of the form.the results are as follows:
Trying to change the last character "r" to other characters does not reproduce this issue.
The issue is not reproduced in the TextBox control. After clicking the resize button, the character line does not change and no rendering occurs,the results are as follows:
from winforms.
We updated the version of riched20.dll that we wrapped sometime around 4.6 if memory serves. @Tanya-Solyanik do you recall? I wouldn't be surprised if this is more of a Windows/Richedit issue than something WinForms is able to control directly.
from winforms.
@Olina-Zhang can your team go ahead and test this in MFC?
@KlausLoeffelmann - you said you were touching the RichTextBox potentially so keep this in mind when you do.
from winforms.
@John-Qiao can you please test MFC to verify it is indeed a newer richedit version issue?
from winforms.
@elachlan I'm not familiar with MFC project, I will try to create a MFC project and test it, but I'm not sure if it will work.
from winforms.
Maybe @Olina-Zhang can help?
from winforms.
@SteffenSchwaiger this bug is about which version of the Rich Text Box control is loaded at runtime by WinForms. @John-Qiao has provided instructions above to reference the earlier versions, which may not produce this issue. This is something that would need a fix from the Office team and Windows to take the fix. I would recommend following @John-Qiao's approach instead.
from winforms.
Related Issues (20)
- The DataGridViews overlap after a certain row when they are placed within the FlowLayoutPanel in WinForms HOT 7
- Unstable unit test: System.Windows.Forms.Tests.TextBoxBaseTests.TextBoxBase_Copy_PasteNotEmpty_Success HOT 1
- Unstable unit test: System.Windows.Forms.Tests.TextBoxBaseTests.TextBoxBase_Undo_CanUndo_Success
- Unstable unit test: System.Windows.Forms.Tests.MenuStripTests.MenuStrip_WndProc_InvokeMouseActivate_Success
- Unstable unit test: System.Windows.Forms.Tests.MenuStripTests.MenuStrip_WndProc_InvokeMouseActivateWithHandle_Success
- Assembly.GetType Throws Exception When Using ControlDesigner in Netcore using Microsoft SDK HOT 6
- Visual Basic Logging configuration via config file broken
- No 8.0.5 or 8.0.6 release? HOT 3
- KeyUp fired many times when RDP session get focus HOT 8
- When the helpNamespace property in helpProvider is blank after delete the previous saved URL, project exit from runtime automatically when press F1 HOT 11
- Introduce Analyzers for correctly guiding the handling of modal dialogs
- [dotnet-sdk-9.0.100-preview.6.24325.8] NotatnikMechanika get System.PlatformNotSupportedException: BinaryFormatter serialization and deserialization have been removed. HOT 3
- [dotnet-sdk-9.0.100-preview.6.24325.8] paintdotnet get System.NotSupportedException: BinaryFormatter serialization and deserialization have been removed HOT 8
- [dotnet-sdk-9.0.100-preview.6.24325.8] Bulk-Crap-Uninstaller launch failed with error: Exception type : System.PlatformNotSupportedException Message : BinaryFormatter serialization and deserialization have been removed HOT 4
- [dotnet-sdk-9.0.100-preview.6.24325.8] JexusManager get System.PlatformNotSupportedException: BinaryFormatter serialization and deserialization have been removed. HOT 3
- [dotnet-sdk-9.0.100-preview.6.24325.8] mRemote launch failed with an exception : PlatformNotSupportedException: BinaryFormatter serialization and deserialization have been removed." HOT 3
- When a ComboBox's data source is bound to an ImmutableArray, its value is reset when it loses focus. HOT 3
- BinaryFormatter error when clicking "Add Tab" command for TabControl in DemoConsole application HOT 4
- Form and controls are not scaled well on HDPI primary monitor when setting custom ApplicationDefaultFont HOT 7
- Graphics.DrawIcon Applies TranslateOffset Twice HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from winforms.