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


gRPC Kotlin 1.0 Released
26/01/2021

Google has announced the 1.0 release of gRPC Kotlin, following its open sourcing last year. gRPC is a high-performance, open-source, universal RPC framework originally developed at Google to help deve [ ... ]



Coursera For New Year-Long Opportunity
30/12/2020

Coursera, the online course provider which partners with leading universities and companies to deliver courses, certificates and even degrees has a great offer to welcome in 2021 - over $100 off a Cou [ ... ]


More News

square

 



 

Comments




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

Last Updated ( Wednesday, 13 January 2021 )