Windows Forms
是微?的
.NET
開發?架的
圖形用戶介面
的一部分,該組件透過將現有的
Windows API
(Win32 API)封裝?
托管代碼
提供了對
Windows
本地(native)?件的訪問方式。雖然該組件看起來是?先前較複雜的基於
C++
的
微軟基礎類庫
(Microsoft Foundation Classes,MFC)的替代品,但是?沒有提供與
Model View Controller
"Document/View"架構相應的特色。"Document/View"架構已經被「
MDI
(多文?介面)」所取代。
該實現位於.NET?架的
System.Windows.Forms
命名空間,?且?試着糾正自己在
Windows XP
背景之下扮演的角色。然而,許多有關於標籤表格與控制單元置於標籤表格上的支援性的顯著問題懸而待決。
許多非微軟官方實現的.NET?架,如
Mono開發平台
,提供了Windows Forms的實現。
微?在.Net 3.0中?行了支持??加速的
Windows Presentation Foundation
(??WPF)作?Windows Forms的替代版本,但是WPF不能完全取代Windows Forms,?多?候仍需要和Windows Forms互操作。
Hello World範例
[
??
]
下面是使用Windows Forms的一個簡單程式,由
C#
?言??。
using
System.Windows.Forms
;
public
class
HelloWorld
{
public
static
void
Main
()
{
MessageBox
.
Show
(
"Hello world!"
);
}
}
外部?接
[
??
]
|
---|
| ??
| |
---|
| 架構
| |
---|
| 共同語言基礎架構
| |
---|
| CLI支持語言
| |
---|
| Core家族
3
| |
---|
| 元件
| |
---|
| 比較
| |
---|
| ?將推出
| |
---|
| |
|