Click here to Skip to main content
11,478,174 members (73,662 online)
Rate this: bad
good
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.
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);
        }
    }
Posted 15-Nov-12 22:35pm

1 solution

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

Solution 1

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
  Permalink  
Comments
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 Sergey Alexandrovich Kryukov 229
1 F-ES Sitecore 170
2 Sascha Lefèvre 160
3 Frankie-C 120
4 OriginalGriff 95
0 Sergey Alexandrovich Kryukov 7,675
1 OriginalGriff 7,321
2 Sascha Lefèvre 3,034
3 Maciej Los 2,491
4 Richard Deeming 2,325


Advertise | Privacy | Mobile
Web04 | 2.8.150520.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