在C#中使UserControl错误无效

时间:2012-03-07 19:33:35

标签: c# winforms user-controls

我创建了一个UserControl,除了属性外,一切都很好。问题是我在UserControl中丢失了所有的设计属性..为了更清楚,我做了一个截图。

这是我的UserControl

enter image description here

..和ToolStrip示例

enter image description here

这是我的示例代码

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Windows.Forms;
using System.ComponentModel.Design;

namespace _Sample__User_Control
{

  [Designer("Sytem.Windows.Forms.Design.ParentControlDesigner,System.Design", typeof(IDesigner))]
  public partial class ClientsCollectionListBox : UserControl
  {
    public ClientsCollectionListBox()
    {
        InitializeComponent();
    }

    [Browsable(true)]
    [DefaultValue("Hello")]
    public string MyString { get; set; }
  }
}

我的用户控件没有设计属性。将用户控件拖到我的表单后,仍然有设计属性,但在运行或向该控件添加另一个实例时,我丢失了显示。任何帮助这个问题将不胜感激。我需要在加载时无效吗?

SOLUTION:

拼写错误..抱歉..请关闭此帖子..

 [Designer("Sytem.Windows.Forms.Design.ParentControlDesigner,System.Design", typeof(IDesigner))]

 [Designer("System.Windows.Forms.Design.ParentControlDesigner,System.Design", typeof(IDesigner))]

0 个答案:

没有答案
相关问题