Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1110
UltraCheckBoxEditor Appearance object is changed after constructor??
posted

I have inherited the UltraCheckEditor in a new class to add some properties.

I have noticed that the Appearance object is changed (internally?) after the constructor is done.

My code looks like this (simplified):

 

    public partial class KTCheckBox : UltraCheckEditor
    {
        private KTControl _controlData;

        public KTCheckBox()
        {
            InitializeComponent();

// This is where I pass the Appearance to my KTControl class. So this class can so something with the colors later.
            _controlData = new KTControl(this.Appearance);
        }

        public void ChangeColor()
        {

            // This does not work! ( _controlData.SetColor does _stored_appearance.ForeColor = ...)
            _controlData.SetColor(Color.Navy);

           // This works
           // this.Appearance.ForeColor = Color.Red;
        }

I did exacty the same with the UltraTextEditor and there it works.
Anyone know what is different with the Checkbox??

 

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi,

    I'm having a hard time understanding this code. You are referencing methods that aren't shown here, so I'm really not sure what you are trying to do.

    There is nothing in the UltraCheckEditor control that sets any properties on itself after it's constructor has been called.

    Did you try checking the control's Appearance to see if the properties you applied to it are still set to what you set them to?

    My only guess is that something else in your code is wiping out the settings later on.

Children
No Data