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


Is PHP in Trouble?
10/04/2024

The April 2024 headline for the TIOBE Index, which ranks programming languages in terms of their popularity, reads, "Is PHP losing its mojo" asking this question because this month PHP has dropped out [ ... ]



Java Version 22 Released
04/04/2024

JDK 22 is not a Long Term Support release, but is one of the regular releases that are scheduled to arrive every six months. Still, it has got a lot to show for itself.


More News

raspberry pi books

 

Comments




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

Last Updated ( Wednesday, 13 January 2021 )