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


A Clock For 2023 - Too Good To Miss
03/09/2023

On this holiday weekend we take a break and look back at the wonder of off-the-wall clocks because it was too good to miss.

I have to admit I have a small passion for freaky clocks. They used to be h [ ... ]



GitHub Enterprise Server 3.10 Improves Security
01/09/2023

Version 3.10 of GitHub Enterprise Server, the self-hosted version of GitHub that organizations can install on their own servers, has been released with improved security and compliance controls.

 [ ... ]


More News

Summer SALE Kindle 9.99 Paperback $10 off!!

esp32book

 

Comments




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

Last Updated ( Wednesday, 13 January 2021 )