Bug 419087 - c'tor of System.Windows.Forms.Control has a bug
Summary: c'tor of System.Windows.Forms.Control has a bug
Status: RESOLVED FIXED
Alias: None
Product: Mono: Class Libraries
Classification: Mono
Component: Windows.Forms (show other bugs)
Version: 1.9
Hardware: i686 Linux
: P5 - None : Critical
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords: Code
Depends on:
Blocks:
 
Reported: 2008-08-21 06:54 UTC by Simon Schaeberle
Modified: 2008-08-23 13:28 UTC (History)
2 users (show)

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


Attachments
TestCaseSolution (14.09 KB, application/octet-stream)
2008-08-21 10:43 UTC, Simon Schaeberle
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Schaeberle 2008-08-21 06:54:08 UTC
Hello,

this is my first bug report. I hope the description is clear.

Description of Problem:
I wrote a component based on System.Windows.Forms.Control. In OnPaint I create a brush an Paint a region.

I wrote 3 c'tors in my component. 1 use as base c'tor System.Windows.Forms.Control() and sets Parent, Left, Top, Height, ... itself. With this base c'tor everything is okay.

2 c'tors use the System.Windows.Forms.Control(Control parent, string text, int left, int top, int width, int height) as base c'tor. With this c'tors I get an OutOfMemeoryException on creating the brush.

This can always be reproduced.

With best regards
Simon Schäberle
Comment 1 Carlos Alberto Cortez 2008-08-21 10:25:35 UTC
Hey,

We actually need a test case (a simple .cs file showing the problem). It would be great if you could cook it from your app to isolate the issue.
Comment 2 Simon Schaeberle 2008-08-21 10:43:19 UTC
Created attachment 234685 [details]
TestCaseSolution

Here is the TestCase Solution. The Exception raises only if a Control is created in the c'tor of a form.
On a Windows maschine with the .Net Framework the testcase works like expected,
Comment 3 Gert Driesen 2008-08-23 13:28:08 UTC
We were invoking SetBounds after modifying the bounds, and as a result OnLocationChanged/OnSizeChanged are never invoked.

I've commit a fix and corresponding unit tests in r111461.