none
Is there any known issue in C# 3.5 where programs hang on System.Windows.Forms.ContainerControl.UpdateFocusedControl() ?

    Question

  • Hello,

    I have a problem with the code I'm working with that I don't quite know how to get my head around. What I am doing is a quite complex application (which unfortunatly is difficult to recreate) that uses MDI child forms as well as supports docking windows in panels left, right, top and bottom in the main form. What I have noticed is that if I dock a MDI window/usercontrol in a panel (docking takes the contained UserControl from within my MDI Form and places it in the panel), presses within the docked UserControl to focus it (a listener calls focus() on the user control) and then finally press close on it, my whole application hangs.

    Using a profiler I see that everything stops at System.Windows.Forms.ContainerControl.UpdateFocusedControl(), which is executed from the base.Dispose method of my windowform (which inherits from Form). The profiler tells me that the computer takes up 50% of cpu from that of the computer hanging. Although there is only one call to System.Windows.Forms.ContainerControl.UpdateFocusedControl(), I have 12 000 000 calls to NotifyLeave within this method, and 18 000 000 calls to get_ParentInternal.

    Is this because of some issue that is known?

    Regards, Johan
    Thursday, December 18, 2008 2:41 PM

Answers

  • Hi Johan,

    As far as I know, about "System.Windows.Forms.ContainerControl.UpdateFocusedControl()" problem, there are some related problem information HERE.

    1. Please have a try to run your application in another computer.
    2. Please consider providing your sample code to do the further troubleshooting.
    3. Please consider giving feedback about this problem to https://connect.microsoft.com/dashboard/info/ , engineers there will provide you with quicker and better responses.
    Thank you!

    Best regards,
    Guo
    • Marked as answer by Guo Surfer Thursday, December 25, 2008 9:18 AM
    Monday, December 22, 2008 10:28 AM

All replies

  • Hi Johan,

    As far as I know, about "System.Windows.Forms.ContainerControl.UpdateFocusedControl()" problem, there are some related problem information HERE.

    1. Please have a try to run your application in another computer.
    2. Please consider providing your sample code to do the further troubleshooting.
    3. Please consider giving feedback about this problem to https://connect.microsoft.com/dashboard/info/ , engineers there will provide you with quicker and better responses.
    Thank you!

    Best regards,
    Guo
    • Marked as answer by Guo Surfer Thursday, December 25, 2008 9:18 AM
    Monday, December 22, 2008 10:28 AM
  • Hi Johan,

    Did you ever resolve this one?  Sounds identical to the problem I'm facing.  Like you, did some profiling and got the high hit count on the same .net methods.

    I saw one mention of it in the micrsoft connect site, but with no resolution.

    Any help you can give me would be much appreciated.

    Reagrds,  MartyO
    Tuesday, June 09, 2009 3:38 PM
  • Hello Marty,

    at the given time I had to give up the issue because I couldn't find anyway to make progress with the bug.
    Now, half a year later, I have tried the scenario again (that always gave the bug) but this time without having the application locking up. I can't remember or say if there was any explicit patch that I have installed, but I can't think of any other explanation to this sudden improvement other than that some patch has been installed.

    Regards, Johan
    Wednesday, June 10, 2009 6:09 AM