Windows Forms Designer

编程入门 行业动态 更新时间:2024-10-27 16:27:21
本文介绍了Windows Forms Designer-自动在类前面添加名称空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在Visual Studio Designer中遇到问题.

I have problem with Visual Studio Designer.

当我显示表单设计时,设计器会自动在类的前面添加名称空间,该名称空间用作数据源. 但是此类与表单位于相同的名称空间.

When I display design of a form, designer automatically adds namespace in front of class, which is used as datasource. But this class is in the same namespace as the form.

这很烦人.

示例:

namespace Editor { partial class AddSignalForm { ... this.signalsBS.DataSource = typeof(Signal); } }

信号在命名空间Editor中.

但是在我打开设计器后,代码更改为:

But after I open designer, code is changed to:

namespace Editor { partial class AddSignalForm { ... this.signalsBS.DataSource = typeof(Editor.Signal); } }

问题是编译器找不到类Editor.Editor.Signal.

Problem is that compiler can not find class Editor.Editor.Signal.

推荐答案

您似乎还有一个名为Editor的类或属性,该类或属性与名称空间冲突.

You seem to have another class or property named Editor which conflicts with the namespace.

更多推荐

Windows Forms Designer

本文发布于:2023-11-09 20:12:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1573313.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Windows   Forms   Designer

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!