2015-05-01 65 views
0

我使用ApplicationSettings来存储经常出现在我的表单中的字符串。我创建了一个名为TextView的“多行标签”作为UserControl,通过以下代码应用文本...如果我重新打开或“重建解决方案”,文本绑定将被删除,但其他属性绑定仍然存在。重新打开项目后ApplicationSettingsBindings丢失

[EditorBrowsable(EditorBrowsableState.Always)] 
    //for showing the property in the code Designer 
    [SettingsBindable(true)] 
    //allows to create an ApplicationSettings Binding in the Designer 
    public override string Text 
    { 
     get{ return text;} 
     set{ text = value; draw(); } 
    } 

的applicationSettings绑定我怎么想,让他们 PdbDr.png 的applicationSettings绑定重新打开我的项目 fMySp.png

(对不起,我不能发表图片还)

我后已经尝试使用“新”而不是“覆盖”,就像我正在为BackColor,Font做的那样。但没有任何改变。 如果它可以帮助,我使用的Visual Studio 2013更新4

+0

你是战斗在UserControl.Text的属性,我想你的时候,你会解决你的问题添加[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] –

+0

非常感谢,它解决了我的问题,使我的一天,我想标记您的评论为答案 – leAthlon

回答

0

解决方案:[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]〜感谢汉斯帕桑特