C#,System.Window.Controls和System.Windows.Forms之间的区别?

5Yr*_*DBA 3 c#

不知道之间的区别System.Window.Controls.TextBox和System.Windows.Forms.TextBox.注意到System.Windows.Forms.TextBox可以InvokeRequried但System.Window.Controls.TextBox不能.

什么是的对口InvokeRequired的System.Window.Controls.TextBox?

看起来如果我们两个都有using System.Window.Controls;,using System.Window.Forms;代码可能会相互冲突?

Pow*_*ord 9

System.Windows.Forms是WinForms并使用代码来布局控件,System.Windows.Controls是WPF并使用XML(特别是XAML)来布局控件.

这两者不是一起工作的.此外,WPF仅存在于.NET 3.0及更高版本中.

或者你还在寻找更多?

  • 您不需要将XAML用于WPF布局,尽管许多人发现它既方便又强大.Windows Forms和WPF之间的真正区别与表示模型和WPF的灵活性有关. (2认同)

SLa*_*aks 5

System.Windows.Forms是WinForms.
System.Windows.Controls是WPF.

它们没有任何共同之处,也不能互换使用.