Bug 317351 (MONO73190) - SWF.Control::CreateControl not always called
Summary: SWF.Control::CreateControl not always called
Status: VERIFIED FIXED
Alias: MONO73190
Product: Mono: Class Libraries
Classification: Mono
Component: Windows.Forms (show other bugs)
Version: unspecified
Hardware: Other All
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Peter Dennis Bartok
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords: regression_test_needed
Depends on:
Blocks:
 
Reported: 2005-03-02 04:37 UTC by Jonathan Gilbert
Modified: 2007-12-13 18:26 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Test case (C# source code) (1.81 KB, text/plain)
2005-03-02 04:39 UTC, Thomas Wiest
Details
Initial "hack" patch (against SVN revision 41339) (2.41 KB, patch)
2005-03-02 04:40 UTC, Thomas Wiest
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:09:34 UTC


---- Reported by 4lw0e0402@sneakemail.com 2005-03-01 21:37:17 MST ----

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.

Actual Results:
  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.

Expected Results:
  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.

Additional Information:
  '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.



---- Additional Comments From 4lw0e0402@sneakemail.com 2005-03-01 21:39:24 MST ----

Created an attachment (id=167520)
Test case (C# source code)




---- Additional Comments From 4lw0e0402@sneakemail.com 2005-03-01 21:40:49 MST ----

Created an attachment (id=167521)
Initial "hack" patch (against SVN revision 41339)




---- Additional Comments From peter@novonyx.com 2005-03-09 03:11:01 MST ----

Fixed in SVN. If the 'hack' attached to this bug was applied, it 
needs to be reverted before updating. Sorry for the delay in getting 
this fixed, had a bout with the flu.

Imported an attachment (id=167520)
Imported an attachment (id=167521)