http://bugzilla.novell.com/show_bug.cgi?id=499058


           Summary: Error setting the "Control.MaximumSize" property in
                    WinForms App
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.2.x
          Platform: x86
        OS/Version: Windows Vista
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: JIT
        AssignedTo: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]
          Found By: ---


Created an attachment (id=288733)
 --> (http://bugzilla.novell.com/attachment.cgi?id=288733)
Screen shot showing correct and incorrect results

User-Agent:       Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;
InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648;
NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)

Manually assigning a Control's Size property and then redirecting that Size to
the same Control's "MaximumSize" property does not result in the proper
outcome. The Control's size (height and width dimensions) erronously become
zero after re-assignment.

Reproducible: Always

Steps to Reproduce:
1. Instantiate a Control (try a Panel control), assign it some dimensions (say
100 x 100) and a location on a simple WinForm app.
2. Point the control's "MaximumSize" property to it's (just modified) size
property (i.e. "MyControl.MaximumSize = MyControl.Size").
3. run app and observe control. Dimensions have values of zero, NOT 100 x 100.
This behavior only occurs on Mono, not Microsoft .NET runtime.

Source code:

namespace BugForm
{
   public partial class Form1 : Form
   {
       public Form1()
       {
           InitializeComponent();

           // Instantiate Panel control:
           Panel MyPanel           = new Panel();
           MyPanel.BackColor     = Color.Black;
           MyPanel.Size             = new Size(100, 100);
           MyPanel.MaximumSize = MyPanel.Size; // This line appears to be
the culprit.
           MyPanel.Location       = new Point(0, 0);
           this.Controls.Add(MyPanel);

           // Display Panel size in Title bar:
           this.Text = "Height: " + MyPanel.Height.ToString() + " Width: "
+ MyPanel.Width.ToString();
       }
   }
}

Actual Results:  
Control is not visible due to improper sizing (height, width = 0).

Expected Results:  
Control should be placed and sized normally on form.

Only tested on Mono 2.2, haven't tried on Mono 2.4 yet.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to