Paul Krill
Editor at Large

Windows Forms advances in .NET 6 but still needs work

news
Nov 23, 20212 mins

Supporting display DPI awareness and sharing display configuration information between the Windows Forms runtime and designer have been challenging, Microsoft said.

Circuits lead to signs that read, 'Under Construction.'
Credit: Frank Peters / Getty Images

The runtime for Windows Forms, Microsoft’s UI framework for building Windows desktop applications, was spruced up with the recent release of .NET 6.0, although high-DPI and scaling issues remain to be resolved for the application.

In a bulletin on Windows Forms improvements published November 16, Microsoft said it had been working through the “high DPI space” trying to get Windows Forms applications to properly support PerMonitorV2 mode, a DPI awareness mode that allows applications to immediately render correctly whenever the DPI changes.

PerMonitorV2 support has been a challenging undertaking and “sadly, we couldn’t achieve as much as we hoped,” Igor Velikorossov, software engineer for Windows Forms at Microsoft, said. But progress has been made in the .NET 6 release, with support for creating controls in the same DPI awareness as the application, and correct scaling of ContainerControl and MDI child windows in PerMonitorV2 mode in most scenarios.

Microsoft cited a number of other changes for Windows Forms in .NET 6.0, which was released on November 8:

<ul> <li>A more streamlined <a href=”https://github.com/dotnet/designs/blob/main/accepted/2021/winforms/streamline-application-bootstrap.md” rel=”nofollow”>Windows Forms application bootstrap</a> that allows sharing of configuration information between the runtime and the designer during  development.</li> <li>Also for application bootstrapping, Visual Basic in .NET 6.0 intruduces a new application event, <code>ApplyApplicationDefaults, to define application-wide settings in the typical Visual Basic way. Also, designer support for the default font configured via MSBuild properties is coming in the near future.
  • Templates have been updated for C# to support global using directives, file-scoped namespaces, and nullable reference types.
  • For accessibility, there is improved support for assistive technology.
  • Porting has been completed for missing designers and designer-related infrastructure to enable building a general purpose designer.
  • New overloads have been implemented for Control.Invoke() and Control.BeginInvoke() methods that take Action and Func<T> and allow writing of more modern and more concise code.
  • Paul Krill

    Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

    More from this author