我无法将现有的Windows窗体添加到我的项目中 [英] I couldn't add an existed Windows Form to my project

查看:105
本文介绍了我无法将现有的Windows窗体添加到我的项目中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Visual C ++的初学者.

我正在和另一个人一起做一个项目.
现在我必须将她的代码添加到我的代码中,但是当我选择将现有项目添加到我的项目并添加她的文件时,我看不到Windows窗体的设计.
只有密码.

我可以通过创建一个新的Windows窗体并用她的文件替换这些文件来解决此问题,但是有很多Windows窗体.

我做不到
实际上,我尝试了一些,但是现在Windows窗体的设计不再是设计,​​而是一些XML代码.

我不知道为什么.

I''m a beginner of Visual C++.

I''m working on a project with another person.
Now I have to add her codes to mine, but when I chose to add existing items to my project and add her files, I couldn''t see the design of a Windows Form.
There are only codes.

I can solve this problem by creating a new Windows Form and replacing the files with hers, but there are a lot of Windows Forms.

I can''t do this.
In fact I tried a few, but for now the design of a Windows Form is no longer design but some XML codes.

I don''t know why.

推荐答案

v.2.0和更高版本中的每个表格都使用partial class功能跨越至少两个不同的文件.开发人员可以使用此原理添加更多文件.这些文件之一用于Designer生成的代码.如果需要在其他项目中移动现有文件,则需要全部移动它们.

我已经做过几次了;它总是对我有用.项目节点的结构可能会丢失(最初,自动生成的代码将作为另一个文件节点的子节点;但是将文件移入项目后,它们可能会显示为对等节点),但是1)即使在这种情况下,该项目在功能上有利于进一步开发,因此您可以忽略该问题; 2)您可以修复结构:使用一种形式创建一个简单的项目,学习这两个文件节点的语法,并在文本编辑器中手动编辑您的项目文件;要非常小心;在手术之前备份您的项目.

与上述第(2)项有关的简短建议:没有版本控制系统就无法工作. Subversion或Git或Bazaar等都是出色的可靠免费产品,带有完整的开源代码.

—SA
Each form in v.2.0 and later spans at least two different files, using partial class feature. The developer could add some more files using this principle. One of these files is used for Designer-generated code. If you need to move existing files in different project, you need to move them all.

I''ve done it several times; it always worked for me. The structure of the project nodes could be lost (originally, auto-generated code goes as a child node of the other file''s node; but after moving files into the project they may appear as peer nodes), but 1) even in this case the project is functionally good for further development, so you can ignore the problem; 2) you can fix the structure: create a simple project with one form, learn the syntax of these two file nodes and manually edit your project file in a text editor; be very careful; backup your project before this surgery.

A short advice related to the item (2) above: don''t work without Revision Control System. Subversion or Git or Bazaar, etc. are wonderful reliable free products with full Open Source code.

—SA


这篇关于我无法将现有的Windows窗体添加到我的项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆