World Library  
Flag as Inappropriate
Email this Article

Windows Forms

Article Id: WHEBN0000826727
Reproduction Date:

Title: Windows Forms  
Author: World Heritage Encyclopedia
Language: English
Subject: .NET Framework, .NET框架, Visual Basic .NET, Portable.NET, DotGNU
Collection: .Net Framework, Microsoft Application Programming Interfaces, Widget Toolkits
Publisher: World Heritage Encyclopedia

Windows Forms

This API is a part of .NET Framework 3.0
Windows Forms

(WinForms) is the name given to a graphical (GUI) class library included as a part of Microsoft .NET Framework,[1] providing a platform to write rich client applications for desktop, laptop, and tablet PCs.[2] 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[3] and only acts as a platform for the user interface tier in a multi-tier solution.[4]


  • Architecture 1
  • Features 2
  • History and future 3
  • Alternative implementation 4
  • See also 5
  • References 6
  • External links 7


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.

Windows Forms provides access to native Windows User Interface Common Controls by wrapping the extant Windows API in managed code.[5] With the help of Windows Forms, the .NET Framework provides a more comprehensive abstraction above the Win32 API than Visual Basic or MFC did.[6]


All visual elements in the Windows Forms class library derive from the Control class. This provides a minimal functionality of a user interface element such as location, size, color, font, text, as well as common events like click and drag/drop. The Control class also has docking support to let a control rearrange its position under its parent. The Microsoft Active Accessibility support in the Control class also helps impaired users to use Windows Forms better.[7]

Besides providing access to native Windows controls like button, textbox, checkbox and listview, Windows Forms added its own controls for ActiveX hosting, layout arrangement, validation and rich data binding. Those controls are rendered using GDI+.[7]

History and 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 existing Windows API and some controls merely wrap underlying Windows components.[8]

Windows Forms provides a cross-platform way to design graphical user interfaces . However 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 non-Windows platforms.[8]

In .Net 2.0, Windows Forms gained richer layout controls, office 2003 style toolstrip controls, multithreading component, richer design-time and data binding support as well as ClickOnce for web-based deployment[9][10]

With the release of .NET 3.0, Microsoft released a second API for rendering GUIs: Windows Presentation Foundation (WPF) based on DirectX,[11] 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.[12]

During a Q and A session at the Build 2014 Conference, Microsoft explained that Windows Forms was under maintenance mode, with no new features being added, but bugs found will still be fixed.[13] Most recently, improved high-DPI support for various Windows Forms controls was introduced in updates to .NET Framework version 4.5.[14]

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;[15] also System.Windows.Forms 2.0 works natively on Mac OS X.[16] However, Windows.Forms is not actively developed on Mono,[17] and full compatibility with .NET is not achieved and is not possible, because 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 other than Windows.[8]

See also


  1. ^ Windows Forms Programming in C# by Chris Sells, Addison-Wesley Professional; 1st edition (September 6, 2003) p xxxviiii
  2. ^ Design and Implementation Guidelines for Web Clients by Microsoft Pattern and Practices. Microsoft (November 2003)
  3. ^ Appendix B. Moving from MFC, Windows Forms 2.0 Programming By Chris Sells, Michael Weinhardt. Addison-Wesley Professional; 2nd edition (May 16, 2006)
  4. ^ Introduction to Windows Forms (Visual Studio 2003 documentation), Microsoft 2003,
  5. ^ C# 4.0 Unleashed By Bart De Smet. Sams Publishing, Jan 4, 2011 Chapter 5 [1]
  6. ^ NET Windows Forms in a Nutshell By Ian Griffiths, Matthew Adams O'Reilly Media (March 2003). p4
  7. ^ a b NET Windows Forms in a Nutshell By Ian Griffiths, Matthew Adams O'Reilly Media (March 2003). p27-53
  8. ^ a b c "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 
  9. ^ Appendix A. What s New in Windows Forms 2.0, Windows Forms 2.0 Programming By Chris Sells, Michael Weinhardt. Addison-Wesley Professional; 2nd edition (May 16, 2006)
  10. ^ Data Binding with Windows Forms 2.0: Programming Smart Client Data Applications with .NET by Brian Noyes, Addison-Wesley Professional; 1st edition (January 12, 2006), Preface
  11. ^ DirectX, not GDI+, Pro WPF and Silverlight MVVM: Effective Application Development with Model By Gary Hall, Apress; 2010 edition (December 27, 2010). p2
  12. ^ Josh Smith (2007-09-05). "WPF vs. Windows Forms". Josh Smith on WPF. Retrieved 2011-08-25. WPF is not intended to replace Windows Forms. [...] Windows Forms 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. 
  13. ^ "A WPF Q&A". 2014-04-03. Retrieved 2014-04-21. Windows Forms is continuing to be supported, but in maintenance mode. They will fix bugs as they are discovered, but new functionality is off the table 
  14. ^ Allen, Jonathan (2014-05-06). "High DPI Improvements for Windows Forms in .NET 4.5.2". InfoQ. Retrieved 2015-02-10. 
  15. ^ "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.  
  16. ^ "WinForms". 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 
  17. ^  

External links

  • MSDN: Building Windows Forms applications
  • MSDN : Windows.Forms reference documentation
  • MSDN : Windows Forms Technical Articles - Automating Windows Form with Visual Test
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.