New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WinForm RichTextBox LinkClicked event fails to fire when control loaded with RTF containing a friendly name hyperlink #1520
Comments
Your title is wrong, the event does fire, your screenshot shows that you are running Process.Start and failing. You cannot use Also note that this isn't a WinForms issue, but a CoreFX issue (you linked one of them yousrelf), and the core issue it already has been discussed resolved as "by design" (can't find the main issue right now or I'd link it, sorry, but the corefx issue you linked yourself contains more discussion and issue links). Cross platform consistency has been deemed more important than backwards compatibility. This is not new for .NET Core 3 but has been a thing in the previews versions as well. |
@ericstj , @karelz can you help us locate the corefx bug that @weltkante links. Can you confirm the failure in the process.start call is by design? @Marie-Shi - you should change the test as @weltkante suggests and confirm that it works. |
@weltkante @merriemcgaw “More info” is another scenario when RichTextBox use Test2.rtf(just add more words than Test.rtf in attached project), click the “Click here”, it is blocked by GitHub issue 33714. But using Test2.rtf in .Net Framework project, click the “Click here”, it opens the browser and navigates to the page of Google. The original problem is in “Problem description”, using Test.rtf, there is no response after clicking the “Click here”. |
|
I believe this is the issue: https://github.com/dotnet/corefx/issues/24704 |
@wtgodbe No thats about what UseShellExecute should do on Linux, though the title doesn't reflect that. The one I had in mind had a discussion about what the right thing to do was, from the three options
Option 3 was decided to be the one to go with (and I agree with that because the other two options make running the same code on different platform pretty much impossible). In hindsight it would probably have been a good idea to also obsolete the API or provide an Analyzer, to avoid the ongoing confusion. (We've done this for our own codebase to make it compatible with both Desktop and Core, with an Analyzer forcing everyone to go through a helper method with fixed semantics or specify UseShellExecute explicitely in the caller.) Small side note, UseShellExecute=true is not even supported among all Windows platforms anymore. |
Fixes dotnet#1311 Fixes dotnet#1520 Fixes dotnet#1607 Fixes dotnet#1644 The bug was introduced as part of refactoring in dotnet#1034 - ordering got flipped with switching `as` to `is`. The confusion was likely caused by the fact that the property setter called its own getter. Update the code to be more explicit in terminology to hopefully avoid this from happening again.
Verified this bug with .Net core 3.0.100-rc1-014190 from release branch, WinForm RichTextBox LinkClicked event can be fired when control loaded with RTF containing a friendly name hyperlink after clicking the “Click here”. |
Explicitly set UseShellExecute to true, because in .NetFramework the default value is true but in .NetCore the default value changed to false See: dotnet/winforms#1520 (comment) and https://github.com/dotnet/corefx/issues/24704
Problem description:
Open attached app in VS and run it.
RichTextBoxCoreApp.zip
Click the “Click here”, then observe the behavior of browser.
Actual behavior:
There is no response after clicking the “Click here”.
Expected behavior:
WinForm RichTextBox LinkClicked event can be fired when control loaded with RTF containing a friendly name hyperlink after clicking the “Click here”.
The text was updated successfully, but these errors were encountered: