Click here to Skip to main content
15,913,669 members
Home / Discussions / C#
   

C#

 
GeneralRe: Use of design?? Pin
PIEBALDconsult28-Jun-10 17:57
mvePIEBALDconsult28-Jun-10 17:57 
GeneralRe: Use of design?? Pin
T M Gray29-Jun-10 10:31
T M Gray29-Jun-10 10:31 
AnswerRe: Use of design?? Pin
Alan Balkany29-Jun-10 5:10
Alan Balkany29-Jun-10 5:10 
QuestionCalling function of other application? Pin
Hum Dum28-Jun-10 1:30
Hum Dum28-Jun-10 1:30 
AnswerRe: Calling function of other application? Pin
Gonzalo Cao28-Jun-10 5:53
Gonzalo Cao28-Jun-10 5:53 
QuestionWhat is Root in Garbage Collector(GC)? Pin
Praveen Raghuvanshi28-Jun-10 0:41
professionalPraveen Raghuvanshi28-Jun-10 0:41 
AnswerRe: What is Root in Garbage Collector(GC)? Pin
riced28-Jun-10 2:24
riced28-Jun-10 2:24 
QuestionRe: What is Root in Garbage Collector(GC)? Pin
Paladin200028-Jun-10 9:37
Paladin200028-Jun-10 9:37 
AnswerRe: What is Root in Garbage Collector(GC)? Pin
riced28-Jun-10 9:48
riced28-Jun-10 9:48 
Questionhow many rolesin the sugeno FIS is used? [modified] Pin
hamidhakimi27-Jun-10 20:02
hamidhakimi27-Jun-10 20:02 
AnswerRe: fuzzy inference Pin
OriginalGriff27-Jun-10 21:31
mveOriginalGriff27-Jun-10 21:31 
GeneralRe: fuzzy inference Pin
hamidhakimi2-Jul-10 20:48
hamidhakimi2-Jul-10 20:48 
QuestionHow to play wav file from Pocket PC Pin
tmducit27-Jun-10 18:48
tmducit27-Jun-10 18:48 
AnswerRe: How to play wav file from Pocket PC Pin
OriginalGriff27-Jun-10 21:34
mveOriginalGriff27-Jun-10 21:34 
QuestionExtending a .Net Control. Implement new functionality in event Pin
sodevrom27-Jun-10 10:22
sodevrom27-Jun-10 10:22 
AnswerRe: Extending a .Net Control. Implement new functionality in event Pin
Jacob Dixon27-Jun-10 10:55
Jacob Dixon27-Jun-10 10:55 
GeneralRe: Extending a .Net Control. Implement new functionality in event Pin
sodevrom27-Jun-10 11:14
sodevrom27-Jun-10 11:14 
GeneralRe: Extending a .Net Control. Implement new functionality in event Pin
Jacob Dixon27-Jun-10 11:18
Jacob Dixon27-Jun-10 11:18 
GeneralRe: Extending a .Net Control. Implement new functionality in event Pin
Jacob Dixon27-Jun-10 11:21
Jacob Dixon27-Jun-10 11:21 
GeneralRe: Extending a .Net Control. Implement new functionality in event Pin
sodevrom27-Jun-10 11:27
sodevrom27-Jun-10 11:27 
GeneralRe: Extending a .Net Control. Implement new functionality in event Pin
Jacob Dixon27-Jun-10 11:37
Jacob Dixon27-Jun-10 11:37 
I know that.

Here is what I created to mimic your problem:

public partial class CustomControl1 : System.Windows.Forms.GroupBox
    {
        public CustomControl1()
        {
            InitializeComponent();
        }

        protected override void OnPaint(PaintEventArgs pe)
        {
            base.OnPaint(pe);
        }

        protected override void OnEnabledChanged(EventArgs e)
        {
            if (this.Enabled)
            {
                // Do whatever here
            }
            else
            {
                // Do whatever here
            }

            foreach (Control c in this.Controls)
                c.Enabled = this.Enabled;

            base.Refresh();
        }
    }


After I created that I created a Windows Form with two group box. One groupbox was my custom one, and the other was an normal group box. Each groupbox had two regular checkboxes in them. I also placed two buttons out to the right (one for Enable and Disable)

private void button1_Click(object sender, EventArgs e)
        {
            customControl11.Enabled = true;
            groupBox1.Enabled = true;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            customControl11.Enabled = false;
            groupBox1.Enabled = false;
        }


Now on my form I click the Disable button and it disables both group boxes and all FOUR checkboxes. I click Enable and it enables them. This is what your problem was correct?
GeneralRe: Extending a .Net Control. Implement new functionality in event Pin
sodevrom27-Jun-10 11:53
sodevrom27-Jun-10 11:53 
GeneralRe: Extending a .Net Control. Implement new functionality in event Pin
Jacob Dixon27-Jun-10 12:11
Jacob Dixon27-Jun-10 12:11 
GeneralRe: Extending a .Net Control. Implement new functionality in event Pin
Johnny J.28-Jun-10 0:51
professionalJohnny J.28-Jun-10 0:51 
AnswerRe: Extending a .Net Control. Implement new functionality in event Pin
DaveyM6927-Jun-10 12:31
professionalDaveyM6927-Jun-10 12:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.