[Mono-bugs] [Bug 444834] New: Winforms tablelayout giving different results for .NET 2. 0 and mono

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Nov 13 16:23:38 EST 2008


https://bugzilla.novell.com/show_bug.cgi?id=444834


           Summary: Winforms tablelayout giving different results for .NET
                    2.0 and mono
           Product: Mono: Class Libraries
           Version: 2.0
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: paul at all-the-johnsons.co.uk
         QAContact: mono-bugs at lists.ximian.com
          Found By: Community User


Created an attachment (id=252054)
 --> (https://bugzilla.novell.com/attachment.cgi?id=252054)
Screen shot of incorrectly sized boxes

I've built an application which runs happily under Win32 and mono. The
design work was done under VS C# 2008, was compiled on there and tested
on both my Linux (fedora) boxes and an XP box.

On XP, everything works fine. Under Linux, the text boxes are not
correctly sized.

The setup code from the Win designer for the table is this

            this.table.ColumnCount = 6;
            this.table.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute,
60F));
            this.table.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent,
25F));
            this.table.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent,
25F));
            this.table.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent,
25F));
            this.table.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent,
25F));
            this.table.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute,
40F));
            this.table.Controls.Add(this.checkBox4, 5, 4);
            this.table.Controls.Add(this.checkBox3, 5, 3);
            this.table.Controls.Add(this.checkBox2, 5, 2);
            this.table.Controls.Add(this.diff4, 4, 4);
            this.table.Controls.Add(this.ass4, 3, 4);
            this.table.Controls.Add(this.teach4, 2, 4);
            this.table.Controls.Add(this.active4, 1, 4);
            this.table.Controls.Add(this.diff3, 4, 3);
            this.table.Controls.Add(this.ass3, 3, 3);
            this.table.Controls.Add(this.teach3, 2, 3);
            this.table.Controls.Add(this.active3, 1, 3);
            this.table.Controls.Add(this.diff2, 4, 2);
            this.table.Controls.Add(this.ass2, 3, 2);
            this.table.Controls.Add(this.teach2, 2, 2);
            this.table.Controls.Add(this.active2, 1, 2);
            this.table.Controls.Add(this.diff1, 4, 1);
            this.table.Controls.Add(this.ass1, 3, 1);
            this.table.Controls.Add(this.teach1, 2, 1);
            this.table.Controls.Add(this.label6, 5, 0);
            this.table.Controls.Add(this.label5, 4, 0);
            this.table.Controls.Add(this.label4, 3, 0);
            this.table.Controls.Add(this.label3, 2, 0);
            this.table.Controls.Add(this.label2, 1, 0);
            this.table.Controls.Add(this.label1, 0, 0);
            this.table.Controls.Add(this.numericUpDown1, 0, 1);
            this.table.Controls.Add(this.numericUpDown2, 0, 2);
            this.table.Controls.Add(this.numericUpDown3, 0, 3);
            this.table.Controls.Add(this.numericUpDown4, 0, 4);
            this.table.Controls.Add(this.active1, 1, 1);
            this.table.Controls.Add(this.checkBox1, 5, 1);
            this.table.Location = new System.Drawing.Point(6, 6);
            this.table.Name = "table";
            this.table.RowCount = 5;
            this.table.RowStyles.Add(new
System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute,
20F));
            this.table.RowStyles.Add(new
System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent,
25F));
            this.table.RowStyles.Add(new
System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent,
25F));
            this.table.RowStyles.Add(new
System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent,
25F));
            this.table.RowStyles.Add(new
System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent,
25F));
            this.table.Size = new System.Drawing.Size(605, 202);
            this.table.TabIndex = 1;

So, as you can see, the table width is 605, two columns make 100 leaving
505, there is a gap between each cell so the largest textbox there can
be is 495 in length).

The window itself has a radio button which that does the following

1. Makes all except active1-4 visible=false
2. Sets the column span to 4
3. Makes the active1-4 textboxes 495,39

The other radio button does the reverse (each box is 120, 39 - should result in
4 evenly spaced boxes - it does under .NET, but not on mono)

The problem is that under Linux there are gaps where they shouldn't be.

Screenshots attached.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list