Windows Forms

Windows Forms (WinForms) is the name given to the graphical application programming interface (API) included as a part of Microsoft .NET Framework, providing access to native Microsoft Windows interface elements by wrapping the extant Windows API in managed code. While it is seen as a replacement for the earlier and more complex C++ based Microsoft Foundation Class Library, it does not offer a paradigm comparable to Model–View–Controller. Some after-market and third party libraries have been created to provide this functionality. The most widely used of these is the User Interface Process Application Block, which is released by the Microsoft patterns & practices group as a free download that includes the source code for quick start examples.

Contents

History & future

Just like Abstract Window Toolkit (AWT), the equivalent Java API, Windows Forms was an early and easy way to provide graphical user interface components to the .NET Framework. Windows Forms is built on the extant Windows API and some controls merely wrap underlying Windows components[1]

Windows Forms provides a cross-platform way to design graphical user interfaces. However WinForms is mainly a wrapper around the Windows API, and some of the methods allow direct access to Win32 callbacks, which are not available in other platforms than Windows[1].

With the release of .NET 3.0, Microsoft released a second API for rendering GUIs: Windows Presentation Foundation (WPF), together with a GUI declarative language called XAML. However, even though both Windows Forms and WPF offer comparable functionality, Windows Forms has not necessarily been superseded by WPF, but is simply another tool for Windows desktop application that will continue to exist parallel to WPF.[2]

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.

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.

Mono's support for System.Windows.Forms as of .NET 2.0 is announced as complete[3] ; also System.Windows.Forms 2.0 works natively on Mac OS X[4]. However, Windows.Forms is not actively developed on Mono[5], and full compatibility with .NET is not achieved and is not possible, because WinForms is mainly a wrapper around the Windows API, and some of the methods allow direct access to Win32 callbacks, which are not available in other platforms than Windows[1].

See also

References

  1. ^ a b c "FAQ: Winforms". mono-project.com. http://www.mono-project.com/FAQ:_Winforms. "It is very unlikely that the implementation will ever implement everything needed for full compatibility with Windows.Forms. The reason is that Windows.Forms is not a complete toolkit, and to work around this problem some of the underlying Win32 foundation is exposed to the programmer in the form of exposing the Windows message handler" 
  2. ^ Josh Smith (2007-09-05). "WPF vs. Windows Forms". http://joshsmithonwpf.wordpress.com/: Josh Smith on WPF. http://joshsmithonwpf.wordpress.com/2007/09/05/wpf-vs-windows-forms/. Retrieved 2011-08-25. "WPF is not intended to replace Windows Forms. [...] WinForms is still alive and well, and will continue to be enhanced and supported by Microsoft for years to come. WPF is simply another tool for Windows desktop application developers to use, when appropriate." 
  3. ^ "WinForms". mono-project.com. http://www.mono-project.com/WinForms. Retrieved 2011-07-30. "Support for Windows Forms 2.0 is complete. At this point, we are largely just fixing bugs and polishing our code. " 
  4. ^ "WinForms". mono-project.com. http://www.mono-project.com/FAQ:_Winformss. Retrieved 2011-07-30. "Does Winforms run on OSX? Yes, as of Mono 1.9, Winforms has a native OSX driver that it uses by default" 
  5. ^ Miguel de Icaza (2011-03-07). "GDC 2011". http://tirania.org/blog/archive/2011/Mar-07.html. Retrieved 2011-07-30. "For tools that are mostly OpenGL/DirectX based, use Windows.Forms, keeping in mind that some bug fixing or work around on their part might be needed as our Windows.Forms is not actively developed." 

External links