[Mono-bugs] [Bug 344445] New: ListBox: items not shown if form size is changed in Load

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Nov 27 16:23:25 EST 2007


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

           Summary: ListBox: items not shown if form size is changed in Load
           Product: Mono: Class Libraries
           Version: 1.2.6
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at ximian.com
        ReportedBy: kobruleht2 at hot.ee
         QAContact: mono-bugs at ximian.com
          Found By: ---


To reproduce, run the code.

Observed: lisbox shows 9 items

Expected: listbox should display 19 items


Code to reproduce:

using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Drawing;

public class Test
{
    static void Main()
    {
        Application.Run(new ReportDialogForm());
    }
}

class ReportDialogForm : Form
{

    public ReportDialogForm()
    {
        tabControl1 = new TabControl();
        tabPage1 = new TabPage();
        reportListBox = new ListBox();
        tabControl1.Anchor = ((AnchorStyles)((((AnchorStyles.Top |
AnchorStyles.Bottom)
                                | AnchorStyles.Left)
                                | AnchorStyles.Right)));
        tabControl1.Controls.Add(tabPage1);
        tabControl1.Location = new System.Drawing.Point(0, 0);
        tabControl1.Padding = new System.Drawing.Point(0, 0);
        tabControl1.SelectedIndex = 0;
        tabControl1.Size = new System.Drawing.Size(591, 296);
        tabControl1.TabIndex = 0;
        tabPage1.Controls.Add(reportListBox);
        tabPage1.Location = new System.Drawing.Point(4, 29);
        tabPage1.Margin = new Padding(0);
        tabPage1.Size = new System.Drawing.Size(583, 263);
        tabPage1.TabIndex = 0;
        tabPage1.Layout += new LayoutEventHandler(tabPage1_Layout);
        reportListBox.Anchor = AnchorStyles.None;
        reportListBox.Size = new System.Drawing.Size(287, 384);
        reportListBox.TabIndex = 1000;
        ClientSize = new System.Drawing.Size(588, 292);
        Controls.Add(tabControl1);

        for (int i = 0; i < 20; i++)
            reportListBox.Items.Add(i.ToString());

        Load += new EventHandler(ReportDialogForm_Load);
    }

    void ReportDialogForm_Load(object sender, EventArgs e)
    {
        StartPosition = FormStartPosition.Manual;
        Location = new Point(10, 10);
        ClientSize = new Size(400, 400);
    }



    void tabPage1_Layout(object sender, LayoutEventArgs e)
    {
        int height = 100;
        reportListBox.Top = height;
        reportListBox.Height = tabPage1.Height - height;
        reportListBox.Width = tabPage1.Width / 2;
        reportListBox.Left = 0;
    }

    TabControl tabControl1;
    TabPage tabPage1;
    ListBox reportListBox;
}


-- 
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