Click here to Skip to main content
15,900,258 members
Home / Discussions / C#
   

C#

 
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 PinPopular
DaveyM6927-Jun-10 12:31
professionalDaveyM6927-Jun-10 12:31 
AnswerRe: Extending a .Net Control. Implement new functionality in event Pin
DaveyM6928-Jun-10 3:06
professionalDaveyM6928-Jun-10 3:06 
QuestionApplication.DoEvents(); throwing System.IO.FileNotFoundException ? Pin
BugMeNotFTW27-Jun-10 4:09
BugMeNotFTW27-Jun-10 4:09 
AnswerRe: Application.DoEvents(); throwing System.IO.FileNotFoundException ? Pin
Roger Wright27-Jun-10 4:58
professionalRoger Wright27-Jun-10 4:58 
AnswerRe: Application.DoEvents(); throwing System.IO.FileNotFoundException ? [modified] Pin
BugMeNotFTW27-Jun-10 6:41
BugMeNotFTW27-Jun-10 6:41 
GeneralRe: Application.DoEvents(); throwing System.IO.FileNotFoundException ? Pin
Roger Wright27-Jun-10 20:38
professionalRoger Wright27-Jun-10 20:38 
AnswerRe: Application.DoEvents(); throwing System.IO.FileNotFoundException ? Pin
Jacob Dixon27-Jun-10 11:47
Jacob Dixon27-Jun-10 11:47 
QuestionSwitching a program from foreground to background Pin
WubbleU26-Jun-10 22:53
WubbleU26-Jun-10 22:53 
AnswerRe: Switching a program from foreground to background Pin
DaveAuld26-Jun-10 23:24
professionalDaveAuld26-Jun-10 23:24 
GeneralRe: Switching a program from foreground to background Pin
WubbleU26-Jun-10 23:28
WubbleU26-Jun-10 23:28 
GeneralRe: Switching a program from foreground to background Pin
Trollslayer26-Jun-10 23:38
mentorTrollslayer26-Jun-10 23:38 
GeneralRe: Switching a program from foreground to background Pin
WubbleU26-Jun-10 23:42
WubbleU26-Jun-10 23:42 
GeneralRe: Switching a program from foreground to background Pin
Trollslayer27-Jun-10 0:09
mentorTrollslayer27-Jun-10 0:09 
GeneralRe: Switching a program from foreground to background Pin
Richard MacCutchan27-Jun-10 0:15
mveRichard MacCutchan27-Jun-10 0:15 

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.