- Not to be confused with Microsoft Forms.
Windows Forms, also known as WinForms, is a free, open-source graphical user interface (GUI) class library for building Windows desktop applications, included as a part of .NET Framework or Mono, providing a platfom to write client applications for desktop, laptop, and tablet PCs. While it is seen as a replacement for the earlier and more complex C++ based Microsoft Foundation Class Library, it does not offer a comparable paradigm and only acts as a platform for the user interface tier in a multi-tier solution.
At the Microsoft Connect event on December 4, 2018, Microsoft announced it was releasing Windows Forms as an open-source project on GitHub under the MIT License. With this release, Windows Forms has become available for projects targeting the .NET Core framework. However, the framework is still only available on the Windows platform, and Mono's incomplete implementation of Windows Forms remains the only cross-platform implementation.
History and future
Just like Abstract Window Toolkit (AWT), the equivalent Java API, Windows Forms was an early and easy way to provide GUI components to the .NET Framework. Windows Forms is built upon the existing Windows API, and some controls merely wrap underlying Windows components. Some of the methods allow direct access to Win32 callbacks, which are not available in non-Windows platforms.
In .NET Framework 2.0, Windows Forms received richer layout controls, Office 2003-style toolstrip controls, multithreading components, richer design-time and data binding support, as well as ClickOnce for web-based deployment.
With the release of .NET Framework 3.0, Microsoft released a second, parallel API for rendering GUIs: Windows Presentation Foundation (WPF), based on DirectX, together with a GUI declarative language called Extensible Application Markup Language (XAML).
Architecture
A Windows Forms application is an event-driven application supported by Microsoft's .NET Framework. Unlike a batch program, it spends most of its time simply waiting for the user to do something, such as fill in a text box or click a button. The code for the application can be written in a .NET programming language such as C# or Visual Basic.
Windows Forms provides access to native Windows User Interface Common Controls by wrapping the existing Windows API in managed code. With the help of Windows Forms, the .NET Framework provides a more comprehensive abstraction above the Win32 API than Visual Basic or MFC did.
Windows Forms is similar to the Microsoft Foundation Class Library (MFC) in developing client applications. It provides a wrapper consisting of a set of C++ classes for the development of Windows applications. However, it does not provide a default application framework like the MFC. Every control in a Windows Forms application is a concrete instance of a class.
Alternative implementation
Mono is a project led by Xamarin (formerly by Ximian, then Novell) to create an Ecma standard-compliant .NET compatible set of tools. In 2011, Mono's support for System.Windows.Forms as of .NET 2.0 was announced as complete; System.Windows.Forms 2.0 works natively on Mac OS X. However, System.Windows.Forms has not been actively developed on Mono. Full compatibility with .NET was not possible because Microsoft's System.Windows.Forms is mainly a wrapper around the Windows API, and some of the methods allow direct access to Win32 callbacks, which are not available in platforms othr than Windows. Mono's WinForms implementation is based on Mono's libgdiplus, which implements GDI+ on top of Gtk and Pango.
See also
- Microsoft Visual Studio
- ClickOnce
References
External links
- MSDN: Building Windows Forms applications
- MSDN : Windows.Forms reference documentation
- MSDN : Windows Forms Technical Articles - Automating Windows Form with Visual Test
- Official community site
|
Stub
This article is a stub, an article too short to provide more than rudimentary information about a subject. You can help the Microsoft Wiki by expanding it.
|