Windows Forms
The Windows Forms (WinForms) technology is a managed wrapper around the native Windows API. It provides a rich set of controls and tools for building traditional desktop applications on the Windows operating system.
Key Namespaces:
System.Windows.Forms
System.Drawing
Button Control
Represents a standard Windows button control.
Properties:
- Text: string - Gets or sets the text displayed on the button.
- Enabled: bool - Gets or sets a value indicating whether the control can respond to user interaction.
- BackColor: Color - Gets or sets the background color of the control.
Events:
- Click: EventHandler - Occurs when the button is clicked.
Example Usage:
TextBox Control
Represents a Windows text box control for user input.
Properties:
- Text: string - Gets or sets the current text in the text box.
- Multiline: bool - Gets or sets a value indicating whether the text box is a multiline text box.
- ReadOnly: bool - Gets or sets a value indicating whether the text in the text box is read-only.
Events:
- TextChanged: EventHandler - Occurs when the text in the text box changes.
Example Usage:
WPF (Windows Presentation Foundation)
WPF is a UI framework that enables rich, interactive user experiences. It uses XAML for declarative UI design and a vector-based rendering engine for high-quality graphics.
Key Namespaces:
System.Windows
System.Windows.Controls
System.Windows.Markup
Button Element (XAML)
Represents a button in WPF, typically defined using XAML.
Example XAML:
Example C# (Code-behind):
Grid Layout Panel
A flexible panel that arranges its children in a table-like structure of rows and columns.
Example XAML:
.NET MAUI
A cross-platform framework for developing native mobile and desktop applications with C# and XAML from a single codebase.
Key Namespaces:
Microsoft.Maui.Controls
Button Control (MAUI)
Represents a button in a MAUI application.
Example XAML:
Example C# (Code-behind):
Layout Panels (MAUI)
MAUI provides various layout options like StackLayout
, Grid
, and FlexLayout
for arranging UI elements.
ASP.NET Web Forms
An older technology for building dynamic web applications using a server-side control model and event-driven programming.
Key Namespaces:
System.Web.UI
System.Web.UI.WebControls
Button Control (Web Forms)
Represents a button that can trigger server-side events.
Example ASPX Markup:
Example C# (Code-behind):