Closed ChidanandMurugaiah closed 4 months ago
It's better to open this issue at https://github.com/dotnet/winforms to get eyes from the team. @dotnet/dotnet-winforms
@Olina-Zhang can you help @ChidanandMurugaiah find the right documentation to help accomplish his goals?
Use DesignMode as a starting point
@Tanya-Solyanik, We are not clear about your explanation regarding using DesignMode
as a starting point. Could you please provide an example or a reference to clarify?
Something like this: if (!DesignMode) { show the form }
We need to display the form while interacting with the Designer, so using DesignMode is not a valid solution for our issue. Could you please provide us with an alternative solution?
There is a blog with instructions on how to create complex WinForms controls for the out-of-process designer. This should answer your questions.
Description
In WinForms, there is an issue where Visual Studio crashes when trying to show a form in design time after disabling the
form.ShowInTaskbar
property. I have replicated this issue by creating a custom control with a property. In the property setter, I initialize a new form, disable theShowInTaskBar
property, and then call theShowDialog
method. When I try to change the value of the property in the property window, Visual Studio crashes.Note: - This issue occurs only in .Netcore. It works properly in .NetFramework.
Sample Link - CustomControl.zip
Reproduction Steps
1.Open the Design page. 2.Drag and Drop the custom control. 3.Open the property window. 4.Change the NativeCheck method value to true.
Expected behavior
Need to show the form properly.
Actual behavior
Visual Studio crashes
Regression?
No response
Known Workarounds
No response
Configuration
Sample version - .Net80 Edition -Windows 11 Enterprise Version - 23H2 OS build - 22631.3593 Experience - Windows Feature Experience Pack 1000.22700.1003.0 Visual Studio version - 17.9.7
Other information
No response