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?

net2

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.

taskdialog

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.

 

More Information

What’s new in Windows Forms runtime in .NET 5.0

Related Articles

.NET 5 Ready For Action

Microsoft Gives Up On UWP

Getting Started with WPF

NET Is One With .NET 5

WPF Lives!

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

 

Banner


Copying From Stack Overflow - It's Not Just A Joke
21/04/2021

On April 1st Stack Overflow played a prank that had some of its community really worried - it was going to make us pay for copying code. But as with all good jokes there was a payoff. Stack Overflow w [ ... ]



Trust and Taint - University of Minnesota Banned By Linux
26/04/2021

Greg Kroah-Hartman has banned the University of Minnesota from contributing to the Linux Kernel and gone to a great deal of effort to revert and re-evaluate 190 patches that had come from the sam [ ... ]


More News

square

 



 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Wednesday, 13 January 2021 )