Click here to Skip to main content
11,412,526 members (70,231 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# .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 at 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
0 OriginalGriff 384
1 Sascha Lefévre 200
2 Maciej Los 155
3 ProgramFOX 130
4 Sergey Alexandrovich Kryukov 110
0 Sergey Alexandrovich Kryukov 9,025
1 OriginalGriff 7,247
2 Maciej Los 3,525
3 Abhinav S 3,248
4 Peter Leow 3,059

Advertise | Privacy | Mobile
Web02 | 2.8.150427.1 | Last Updated 16 Nov 2012
Copyright © CodeProject, 1999-2015
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