如何为插入的Form.h切换到Form Designer? [英] How to switch to Form Designer for inserted Form.h?

查看:96
本文介绍了如何为插入的Form.h切换到Form Designer?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设计了一个Winform表单,可以说是Form1.h.我可以切换到其Form设计器并删除组件等.现在,如果我将此Form1.h插入其他解决方案/项目中,则可以编译,调用Form,但无法切换到表单设计器.就像一个普通的.h文件.我如何使VS2008理解这是一种表格,以便可以对其进行可视化编辑?

我使用VS2008 C ++/CLR.​​感谢

I have designed a Winform Form, lets say Form1.h. I can switch to its Form designer and drop components etc. Now, if i insert this Form1.h in a different solution/project, i can compile, call the Form, but i cannot switch to the form designer. It''s like a plain .h file. How can i make VS2008 understand that this is a form, so that i can edit it visually?

I''m using VS2008 C++/CLR.
Thanks

推荐答案

不久前我遇到了一个类似的问题(使用VS2005 Pro).这是我解决问题的方法

1.在项目中,您需要Form1的副本,只需添加一个新的Form对象.请确保将其命名为Form1很好(或在原始项目中调用的任何形式).
2.删除刚创建的表单的.h和.cpp文件.单独保留.resx文件.
3.将Form1.h和Form1.cpp从原始项目复制到新项目并进行编译.确保将它们重命名为您刚刚删除的表单.由于您现在复制的表单具有相同的名称,因此应该可以正常工作.

我不确定这是否正是我所做的,但我已将其记录在工作中.我可以在星期一检查一下.

Dybs
I ran into a similar problem not long ago (using VS2005 Pro). Here''s how I solved it

1. In the project you want a copy of the Form1, simply add a new Form object. Be sure to call it Form1 was well (or whatever you called it in your original project).
2. Delete the .h and .cpp files for the form you just created. Leave the .resx file alone.
3. Copy Form1.h and Form1.cpp from your original project to your new project and compile. Be sure to rename them to whatever you called the form you just deleted. Since your copied form is now the same name, it should work just fine.

I''m not certain if this is exactly what I did, but I have it documented at work. I can check on it Monday.

Dybs


这篇关于如何为插入的Form.h切换到Form Designer?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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