日期:2014-05-17  浏览次数:20732 次

类引用System.Windows.Forms变窗体
类引用System.Windows.Forms变窗体

这个是为什么?假如我还是想继续让他是一个类而不是窗体呢?应该怎么弄?

先谢谢了~

------解决方案--------------------
你如果写
class A : System.Windows.Forms.Form
{
    ...
}
就会变窗体

如果你写
using System.Windows.Forms;
class A
{
    ...
}
就不会。
------解决方案--------------------
class A : System.Windows.Forms.Form //这样才可以,继承自Form类,才能拥有Form的特性。
using System.Windows.Forms;//这样是不可以的,只是引用了命名空间而已。