且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

你如何将现有的形式添加到一个新的项目?

更新时间:2023-12-02 22:04:40

一些研究之后,我发现了问题的根源。这是正确的,所有的人都有导入是 * CS 文件。需要说明的在于项目类型。如果在一个类库项目的工作,另一个步骤必须执行。

After some more research I discovered the source of the issue. It is correct that all one has to import is the *.cs file. The caveat lies in the project type. If working in a Class Library project, another step must be performed.


  1. 添加到 System.Windows参考。 Forms.dll System.Drawing中

  2. 导入 *。CS 文件

  1. Add a reference to System.Windows.Forms.dll and System.Drawing.
  2. Import the *.cs file

注:

一个。之后,我执行了这些步骤,然后尝试打开该文件中的文件只能正确识别。突然VS唤醒并固定文件。

B的步骤无关紧要订单。如果您已经导入*的.cs文件,刚修好的引用。

C.如果一个人缺少其他参考资料(EG的DevExpress或其他第三方控制进口),将*的.cs文件将无法正常显示直到这个已经解决了。

A. The files are only properly recognized after I performed these steps and then tried to open the file. Suddenly VS "wakes up" and fixes the files.
B. Order of the steps does not matter. If you already imported *.cs files, just fix the references.
C. If one is missing other references (E.G. DevExpress or other 3rd party Control imports), the *.cs files will not display properly until this has been resolved.