[Mono-bugs] [Bug 73190][Nor] New - SWF.Control::CreateControl not always called
Tue, 1 Mar 2005 21:37:18 -0500 (EST)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by firstname.lastname@example.org.
--- shadow/73190 2005-03-01 21:37:18.000000000 -0500
+++ shadow/73190.tmp.24504 2005-03-01 21:37:18.000000000 -0500
@@ -0,0 +1,50 @@
+Product: Mono: Class Libraries
+Summary: SWF.Control::CreateControl not always called
+Description of Problem:
+ Under certain circumstances, the CreateControl() method of Control is
+ not called.
+Steps to reproduce the problem:
+ The problem is reproduced with the attached test case. It consists of
+ a custom Form and a custom Control. The control changes its background
+ colour from red to green when OnControlCreated notification is received.
+ The Form displays two checkboxes which also indicate whether
+ OnControlCreated has been called for the Form and the Control,
+ respectively. The test case takes one command-line argument: When
+ "-direct" is the first parameter on the command-line, the custom Form
+ is passed directly to Application.Run. Otherwise, a generic Form is
+ created with a Button which, when clicked, creates the custom Form and
+ calls its Show() method.
+ When the "-direct" flag is passed to the test case, CreateControl() is
+ called as expected for both the Form and the Control it contains.
+ However, without the "-direct" flag, when the problem Form is not the
+ first form created (the form passed to Application.Run), neither Form
+ nor Control have their CreateControl method called.
+ Based on observation of code running under Microsoft's implementation of
+ System.Windows.Forms, CreateControl should always be called at some
+ point near the start of the control's lifetime.
+ 'pdb' of #mono-winforms on irc.gnome.org created an initial patch, in
+ his words a hack. It is attached to this bug for reference, in case
+ it will help with the creation of a production-quality patch.