Click here to Skip to main content
12,756,621 members (30,306 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# VB .NET VB.NET
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.

 public class NumericEditBoxBase : NumericEditBox
        public NumericEditBoxBase()
        private void InitializeComponent()
            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);



        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);
Posted 15-Nov-12 22:35pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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

Please refer

Hamid Noahdi 16-Nov-12 4:31am
Thanks, but i'm confused , could you please help me what should i add to code above in order to:
when i drag my costume component on the form it get initialized but when i change the property, after rebuilding project it still have the changed property.
Thanks again

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 16 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100