Windows Forms
826727
225567110
2008-07-14T10:09:51Z
SmackBot
433328
Date the maintenance tags or general fixes
[[Image:DotNet3.0.svg|thumb|right|300px|This [[API]] is a part of [[.NET Framework 3.0]]]]'''Windows Forms''' is the name given to the [[graphical user interface]] [[application programming interface|application programming interface (API)]] included as a part of [[Microsoft|Microsoft's]] [[.NET Framework]], providing access to the native [[Microsoft Windows]] interface elements by wrapping the existing [[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 address this issue. The most widely used of these is the [http://www.microsoft.com/downloads/details.aspx?familyid=98C6CC9D-88E1-4490-8BD6-78092A0F084E&displaylang=en| 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.
==Components==
===Windows Forms application===
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 like fill in a [[text box]] or click a [[button (control)]].
===BackgroundWorker===
''BackgroundWorker'' is a [[utility class]]. Calling time-consuming code directly from the [[Graphical user interface|GUI]] classes will work, but it will perform in the same [[Thread (computer science)|thread]] as the main [[Graphical user interface|GUI]] thread, so if the method needs time to perform, the GUI will freeze during this time.
BackgroundWorker is useful when a time-consuming task has to be performed following a user-interaction event, as it execute the code in another background thread before returning the result to the main [[Graphical user interface|GUI]] thread.
[[SwingWorker]] is the equivalent [[Java (programming language)|Java]] class.
===Windows Forms control===
The ''control'' class contains [[Graphical user interface|GUI]] components.
===Binding object===
A ''binding object'' is created for each [[bound property]] of a Windows Forms control.
==Hello world example==
The following is a simple [[C Sharp (programming language)|C#]] program using Windows Forms.
<source lang="csharp">
using System;
using System.Windows.Forms;
public class HelloWorld
{
[STAThread]
public static void Main()
{
MessageBox.Show("Hello world!");
}
}
</source>
==Alternative implementation==
[[Mono (software)|Mono]] is a project led by [[Novell]] (formerly by [[Ximian]]) to create an [[Ecma International|Ecma]] standard compliant [[.NET Framework|.NET]] compatible set of tools.
As of [[13 May]] [[2008]], Mono's System.Windows.Forms 2.0 is API complete (contains 100% of classes, methods etc. in Microsoft's System.Windows.Forms 2.0); also System.Windows.Forms 2.0 works natively on Mac OS X{{Fact|date=July 2008}}.
==See also==
* [[Microsoft Visual Studio]]
* [[ClickOnce]]
* [[Swing (Java)|Swing]], the equivalent [[graphical user interface|GUI]] [[application programming interface|application programming interface (API)]] for the [[Java (programming language)|Java programming language]]
* [[Visual Component Library|VCL - Borland's Visual Component Library]]
== External links ==
<!--===========================({{NoMoreLinks}})===============================
| PLEASE BE CAUTIOUS IN ADDING MORE LINKS TO THIS ARTICLE. WIKIPEDIA IS |
| NOT A COLLECTION OF LINKS NOR SHOULD IT BE USED FOR ADVERTISING. |
| |
| Excessive or inappropriate links WILL BE DELETED. |
| See [[Wikipedia:External links]] and [[Wikipedia:Spam]] for details. |
| |
| If there are already plentiful links, please propose additions or |
| replacements on this article's discussion page. Or submit your link |
| to the appropriate category at the Open Directory Project (www.dmoz.org)|
| and link back to that category using the {{dmoz}} template. |
===========================({{NoMoreLinks}})===============================-->
* [http://www.microsoft.com/events/series/windowsforms.mspx MSDN: Building Windows Forms applications]
* [http://msdn2.microsoft.com/en-us/library/dd30h2yb.aspx MSDN : Windows.Forms reference documentation]
* [http://windowsclient.net/ Official community site]
* [http://www.codeproject.com/vb/net/#Windows+Forms Code Project: Windows Forms application samples]
{{dotNET}}
[[Category:.NET framework]]
[[Category:Widget toolkits]]
[[Category:Microsoft application programming interfaces|Forms]]
{{windows-stub}}
[[de:Windows Forms]]
[[id:Windows Forms]]
[[it:Windows Forms]]
[[ja:Windows Forms]]
[[ru:Windows Forms]]
[[zh:Windows Forms]]