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

Windows Forms (WinForms) is a graphical (GUI) class library included as a part of Microsoft .NET Framework or Mono 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]

At the Microsoft Connect event on December 4, 2018, Microsoft announced releasing Windows Forms as open source project on GitHub. It is released under the MIT License. With this release, Windows Forms has became available for projects targeting the .NET Core framework. However, the framework is still available only on Windows platform and the Mono's incomplete implementation of WinForms remains the only cross-platform implementation.[5][6]

XAML Backwards Compatibility with WinForms

For future development, Microsoft has succeeded WinForms with XAML based GUI entry using Frameworks such as WPF and UWP. However, drag and drop placement of GUI components in a manner similar to WinForms is still provided in XAML by replacing the root XAML element of the Page/Window with a "Canvas" UI-Control. When making this change, the user can build a window in a similar fashion as in WinForms by directly dragging and dropping components using the Visual Studio GUI.

While XAML provided drag and drop placement backwards compatibility through the Canvas Control, XAML Controls are only similar to WinForm Controls and are not 1-to-1 backwards compatible. They perform similar functions and have a similar appearance, but the properties and methods are different enough to require remapping from one API to another.

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.

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

Windows Forms is similar to Microsoft Foundation Class(MFC)library in developing client applications. it provides a wrapper consisting of a set of C++ classes for development of Windows applications. However, it does not provide a default application frame work like the MFC. Every control in Windows Forms application is a concrete instance of a class.[from programming of c sharp book]

Features

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.[9]

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+.[9]

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.[10] Some of the methods allow direct access to Win32 callbacks, which are not available in non-Windows platforms.[10]

In .NET Framework 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.[11][12]

With the release of .NET 3.0, Microsoft released a second, parallel API for rendering GUIs: Windows Presentation Foundation (WPF) based on DirectX,[13] together with a GUI declarative language called XAML.[14]

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

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

See also

References

  1. ^ Sells, Chris (September 6, 2003). Windows Forms Programming in C# (1st ed.). Addison-Wesley Professional. p. xxxviiii.
  2. ^ "Design and Implementation Guidelines for Web Clients by Microsoft Pattern and Practices". Microsoft. November 2003.
  3. ^ Sells, Chris; Weinhardt, Michael (May 16, 2006). "Appendix B". Moving from MFC, Windows Forms 2.0 Programming (2nd ed.). Addison-Wesley Professional.
  4. ^ "Introduction to Windows Forms" (Visual Studio 2003 documentation). Microsoft 2003.
  5. ^ Martin, Jeff (4 December 2018). "Microsoft Open Sources WPF, WinForms, and WinUI". InfoQ. Retrieved .
  6. ^ Hanselman, Scott (4 December 2018). "Announcing WPF, WinForms, and WinUI are going Open Source". Retrieved .
  7. ^ De Smet, Bart (January 4, 2011). "Chapter 5". C# 4.0 Unleashed. Sams Publishing.
  8. ^ Griffiths, Ian; Adams, Matthew (March 2003). NET Windows Forms in a Nutshell. O'Reilly Media. p. 4.
  9. ^ a b Griffiths, Ian; Adams, Matthew (March 2003). NET Windows Forms in a Nutshell. O'Reilly Media. pp. 27-53.
  10. ^ a b c "FAQ: Winforms". mono-project.com. 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
  11. ^ Sells, Chris; Weinhardt, Michael (May 16, 2006). "Appendix A. What s New in Windows Forms 2.0". Windows Forms 2.0 Programming (2nd ed.). Addison-Wesley Professional.
  12. ^ Noyes, Brian (January 12, 2006). "Preface". Data Binding with Windows Forms 2.0: Programming Smart Client Data Applications with .NET (1st ed.). Addison-Wesley Professional.
  13. ^ Hall, Gary (December 27, 2010). "DirectX, not GDI+". Pro WPF and Silverlight MVVM: Effective Application Development with Model (2010 ed.). Apress. p. 2.
  14. ^ Smith, Josh (2007-09-05). "WPF vs. Windows Forms". Josh Smith on WPF. Retrieved . 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.
  15. ^ "A WPF Q&A". infoq.com. 2014-04-03. Retrieved . 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
  16. ^ Allen, Jonathan (2014-05-06). "High DPI Improvements for Windows Forms in .NET 4.5.2". InfoQ. Retrieved .
  17. ^ "WinForms". mono-project.com. Retrieved . Support for Windows Forms 2.0 is complete. At this point, we are largely just fixing bugs and polishing our code.
  18. ^ "WinForms". mono-project.com. Retrieved . Does Winforms run on OSX? Yes, as of Mono 1.9, Winforms has a native OSX driver that it uses by default
  19. ^ de Icaza, Miguel (2011-03-07). "GDC 2011". Retrieved . 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


  This article uses material from the Wikipedia page available here. It is released under the Creative Commons Attribution-Share-Alike License 3.0.

Windows_Forms
 



 

Connect with defaultLogic
What We've Done
Led Digital Marketing Efforts of Top 500 e-Retailers.
Worked with Top Brands at Leading Agencies.
Successfully Managed Over $50 million in Digital Ad Spend.
Developed Strategies and Processes that Enabled Brands to Grow During an Economic Downturn.
Taught Advanced Internet Marketing Strategies at the graduate level.


Manage research, learning and skills at defaultlogic.com. Create an account using LinkedIn to manage and organize your omni-channel knowledge. defaultlogic.com is like a shopping cart for information -- helping you to save, discuss and share.


  Contact Us