Click here to Skip to main content
15,914,322 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I'm trying to create a control and command control them from the property, there are too many similar statements. I want to cage them in a group of properties, so I have created a class that contains the property and call them from the main property of a control class.
I have a small statement, but does not work. how to display the property in the father's property
Specific CustomForeColor in DisplayCustomProperties
Thanks for your help
C#
using System.ComponentModel;

namespace WindowsFormsApplication1
{
   public class CustomPanel: Label 
    {
       private CustomProperties _DisplayCustomProperties;
      [Browsable(true),Category("Appearance"), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] 
        public CustomProperties DisplayCustomProperties
        {
            get
            {
                return _DisplayCustomProperties;
            }
            set
            {
                _DisplayCustomProperties = value;
            }
        }
     }
}

C#
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;

namespace WindowsFormsApplication1
{
    public abstract class CustomProperties 
    {
        public enum ArrowColor { Red, Green, Magenta, Pink, Orange, Black, Yellow };
        protected CustomPanel _cpl;
        public CustomProperties(CustomPanel cpl)
        {
            this._cpl = cpl;
        }

        private ArrowColor _CustomForeColor;
        [Browsable(true), Category("Appearance")]
        public ArrowColor CustomForeColor{
            get { return _CustomForeColor; }
            set { _CustomForeColor = value; }
        }
    }
}
Posted

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900