向现有解决方案添加新表单 - 而不是现有表单中的类选项 [英] Adding new forms to existing solution - not a class option in existing forms

查看:48
本文介绍了向现有解决方案添加新表单 - 而不是现有表单中的类选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在c#world中迈出第一步... 

Making my first steps in c# world.. 

我已经有了Windows的现有解决方案我希望为它添加更多Windows窗体的表单。这很容易。

I've got an existing solution with Windows forms which I wanted to add few more Windows forms to it. That was the easy part.

我可以将新添加的表单添加到"查看"中彼此作为一个类并按一个按钮从另一个表单打开一个表单

I can get the new added forms to "see" each other as a class and make a button to open one form from the other form

我可以得到"旧的"现有表格"看"彼此作为一个类,并创建一个按钮,从另一个表单打开一个表单。

I can get the "old" existing forms to "see" each other as a class and make a button to open one form from the other form.

问题是新表单不会从旧表单和副表单中作为可选类出现反之亦然(所有形式都在相同的解决方案中。)..我缺少什么?

The issue is that the new forms are not coming up as a selectable class from the old forms and vice versa (all forms are in same solution.).. what am I missing?

谢谢

推荐答案

您可能错过了命名空间。如果旧表单位于一个名称空间中而新表单位于不同名称空间中,那么如果要从另一个名称空间中调用一个名称,则需要编写完整名称空间(如MyNamespace.Form3),或者添加一个语句"using $ b $" b MyNamespace"在调用表单的开头。
You are probably missing the namespace. If the old forms are in one namespace and the new ones in a different namespace, then if you want to call one from the other you need to write the full namespace such as MyNamespace.Form3, or add a statement "using MyNamespace" at the beginning of the calling form.


这篇关于向现有解决方案添加新表单 - 而不是现有表单中的类选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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