Click here to Skip to main content
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 DamithSL 285
1 Zoltán Zörgő 170
2 OriginalGriff 140
3 BillWoodruff 125
4 Sergey Alexandrovich Kryukov 120
0 OriginalGriff 7,740
1 DamithSL 5,769
2 Sergey Alexandrovich Kryukov 5,424
3 Maciej Los 5,076
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web04 | 2.8.141223.1 | Last Updated 16 Nov 2012
Copyright © CodeProject, 1999-2014
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