无法在 C# 2010 中的表单上打开设计器

发布于 2024-12-18 11:46:52 字数 131 浏览 5 评论 0原文

我通过 VB6 的 Artinsoft 转换在 C# 2010 中生成了一个解决方案。

当我在 C# 中打开新解决方案时,我右键单击表单,但没有“视图设计器”选项。我认为这是因为某些东西无法编译。可能是什么问题以及我应该如何解决它?

I have generated a solution in C# 2010 by way of the Artinsoft conversion from VB6.

When I open the new solution in C# I right-click on the forms but there is no "View Designer" option. I assume this is because something is failing to compile. What could be the problem and how should I fix it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

雾里花 2024-12-25 11:46:52
  • 尝试清理并重建
  • 确保您有正确的Designer.cs文件
  • 确保从表单的构造函数中调用初始化方法。
  • 确保是否有任何自定义 dll,它们位于正确的位置。
  • 最好在 Windows 窗体中创建一个新应用程序并检查内容是如何安排的。以便您可以比较转换。
  • Try a clean and rebuild
  • Make sure you have proper designer.cs file
  • Make sure the initialize method is called from the constructor of your Forms.
  • Make sure if there are any custom dlls they are in right places.
  • Better create a new app in Windows forms and check how the things are arranged. so that you can compare the conversion.
烛影斜 2024-12-25 11:46:52

我不认为这是因为编译失败,而是因为无法正确转换。即使该类未编译,如果它是一个表单,您应该能够查看和编辑表单部分。

I would not expect that from a failure to compile, but rather a failure to convert properly. Even if the class doesn't compile, if it's a form you shouldbe able to see and edit the form portion.

耳根太软 2024-12-25 11:46:52

如果编译失败,应在错误列表中标记原因。更有可能的是,它只是将其创建为一个类(不继承自 Form)。

检查是否存在 MyForm.Designer.cs(其中您的表单名称为 MyForm),并检查 MyForm.cs 中的类声明是否继承自表单。

public partial class MyForm : Form

如果不是这种情况,则它尚未正确转换,因此您可能必须从表单继承,再次放置 UI 控件并将它们连接到任何事件

The reason should be marked in the error list if it's failing to compile. It's more likely that it's created it as just a class (that doesn't inherit from Form).

Check that there's a MyForm.Designer.cs (where your form name is MyForm) and also check that the declaration of the class in MyForm.cs inherits from form

public partial class MyForm : Form

If this isn't the case, it hasn't converted properly, so you may have to inherit from form, drop on the UI controls again and hook them up to any events

愿得七秒忆 2024-12-25 11:46:52

您是否尝试过以管理员身份运行 Visual Studio(提升权限)?

Have you tried running Visual Studio as Administrator (elevated rights)?

生活了然无味 2024-12-25 11:46:52

您可以尝试 Shift+F7 组合键吗?

Can you try Shift+F7 key combination?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文