Windows Forms

from Wikipedia, the free encyclopedia

Windows Forms is a GUI toolkit of the Microsoft .NET Framework . It enables the creation of graphical user interfaces (GUIs) for Windows . This is done by wrapping the existing Windows API in managed code . As part of the Mono project , Windows Forms is largely also available under Linux and macOS .

Compared to other programming interfaces

Compared to Microsoft Foundation Classes (MFC), which is based on the C ++ programming language , getting started with programming with Windows Forms is easier. The framework is not based on the Model View Controller (MVC) paradigm . However, some libraries from other providers offer the necessary functionalities - the “Process Application Block”, a library made available for free download by Microsoft's developer group patterns & practices , is most used. It contains the source code of the core library and examples to help you get started.

With .NET Framework 3.0 Microsoft has provided an alternative to Windows Forms, the Windows Presentation Foundation , which enables a stronger separation of the graphical user interface from the program code and - with the help of XAML , an XML-based language - a more dynamic layout.

Hello world example

Below is a simple C # program that uses Windows Forms.

using System;
using System.Windows.Forms;

public class HalloWelt
{
   [STAThread]
   public static void Main()
   {
      Form form = new Form();
      Button b = new Button();
      b.Text = "Hello World!";
      form.Controls.Add(b);
      form.Show();
      Application.Run(form);
   }
}

literature

  • Dirk Louis: Windows Forms with Visual C ++. Entry level and professional use ,entwickler.press 2008, ISBN 978-3935042888
  • Brian Noyes: Data Binding with Windows Forms 2.0: Programming Smart Client Data Applications with .NET , Addison-Wesley 2006, ISBN 978-0321268921
  • Charles Petzold: Windows Forms Programming with Visual C # 2005 , Microsoft Press 2006, ISBN 978-3860639856

Web links

Individual evidence

  1. User Interface Process Application Block for .NET