构建解决方案后重新初始化设计器中的更改 [英] Changes in designer reinitialized after building the solution

查看:85
本文介绍了构建解决方案后重新初始化设计器中的更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个从控件继承的类
我在继承的类中设置了一些我想要的属性
我从中拖动我的自定义控件,然后更改一些属性.但是当我重建它时,设计器中的更改消失了,再次像基本控件一样.
这是我的代码,我想将设计器中的ValueType更改为十进制.
谢谢.

I have a class inherited from a control
I set some properties that i want in inherited class
i drag my custom control in the from then change some properties. but when i rebuild it, changes in designer is disappeared and again is like base control.
This is my code, i want to change the ValueType in designer to decimal.
Thanks.

public class NumericEditBoxBase : NumericEditBox
   {
       public NumericEditBoxBase()
       {
           InitializeComponent();
       }
       private void InitializeComponent()
       {
           this.SuspendLayout();
           this.VisualStyle = Janus.Windows.GridEX.VisualStyle.Office2010;
           this.OfficeColorScheme = Janus.Windows.GridEX.OfficeColorScheme.Custom;
           this.ValueType = Janus.Windows.GridEX.NumericEditValueType.Int64;
           this.TextAlignment = Janus.Windows.GridEX.TextAlignment.Center;

           this.Enter += new System.EventHandler(this.NumericEditBoxBase_Enter);
           this.Leave += new System.EventHandler(this.NumericEditBoxBase_Leave);


           this.ResumeLayout(false);

       }

       private void NumericEditBoxBase_Enter(object sender, EventArgs e)
       {
           this.OfficeCustomColor = Color.Black;
           this.BackColor = Color.DimGray;
           this.ForeColor = Color.FromKnownColor(KnownColor.Window);
       }

       private void NumericEditBoxBase_Leave(object sender, EventArgs e)
       {
           this.OfficeCustomColor = Color.DimGray;
           this.BackColor = Color.FromKnownColor(KnownColor.Window);
           this.ForeColor = Color.FromKnownColor(KnownColor.WindowText);
       }
   }

推荐答案

嗨 这将由Visual Studio .NET设计器重新初始化.您可能需要使用System.ComponentModel.Design.Serialization.CodeDomSerializer.

请参考
Hi This will be reinitialized by the Visual Studio .NET Designer. You may need to work with System.ComponentModel.Design.Serialization.CodeDomSerializer.

Please refer

[^ ]

问候
多米尼克

[^]

Regards
Dominic


这篇关于构建解决方案后重新初始化设计器中的更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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