|New In Windows Forms .NET|
|Written by Mike James|
|Wednesday, 13 January 2021|
Yes, you read that headline correctly. Despite being out of favor and in maintenance mode, WinForms is still capable of a surprise or two. How can .NET 5.0 introduce new features for something that isn't developing?
The answer is that, while WinForms has been in hold mode for a while, it had features added in various versions of Windows that were never added to the "official" libraries. Since WinForms was open sourced in 2018 and ported to .NET Core it has been open to the possibility of supporting these "new" features. Various people made efforts to encapsulate the mostly undocumented and more-or-less unofficial UI components. Now they are officially supported as part of .NET 5.0 - which is another illustration of the power of open source.
Microsoft might not care about WinForms any more but we still do.
What can you look forward to using?
A new task dialog box - a bit like a message box but with more options and flexibility.
ListView was improved in Windows Vista, remember Vista? You can now work with collapsible groups, subtitles and footers.
The FileDialog is ancient and yet there is a hidden API that allows you to persist its state under different conditions. You pass it a generated GUID and it remembers its state. This means you can offer the user several types of FileDialog, each one remembering its last use.
UI Automation, which arguably didn't catch on because it wasn't uniformly supported, has been implemented for Button, ListView, CheckBox etc.. Who knows, it might actually become popular now.
The framework has also had some improvements in efficiency by improving the interop layer - not really a WinForms enhancement, more a .NET improvement, but still welcome.
Strangely some improvements are claimed to be due to using the GDI rather than the GDI+, which is a step back to get a step forward.
There are plans in the future to improve the High DPI behavior of the renderer, but to an extent this implies that WinForms applications might be targeting tablets or other high DPI devices and I'm not sure that this is likely. A much better bet would be WPF, which currently doesn't seem to be getting much attention.
OK, you may be underwhelmed by the progress - but keep in mind the fact that there is any progress at all is a mark of the success of open sourcing WinForms - we can only hope WPF follows this pattern.
or email your comment to: firstname.lastname@example.org
|Last Updated ( Wednesday, 13 January 2021 )|