[Mono-bugs] [Bug 424276] New: Form: not closed if combobox contents is cleared

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Sep 8 06:08:46 EDT 2008


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


           Summary: Form: not closed if combobox contents is cleared
           Product: Mono: Class Libraries
           Version: SVN
          Platform: x86
        OS/Version: Windows Vista
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: kobruleht2 at hot.ee
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


To reproduce:

1. Run code
2. Press space to clear combobox contents
3. Try to close window by pressing close button in upper right corner.

Observed:

Form does not close.

Expected:

Form should close.


Code to reproduce:

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

class testForm : Form
{
    testForm()
    {

        ComboBox cm = new ComboBox() { DisplayMember = "DisplayMember",
ValueMember = "Code" };
        List<Product> prodList = new List<Product>();
        prodList.Add(new Product() { Code = "001", Name = "Wine", Cb = cm });
        prodList.Add(new Product() { Code = "002", Name = "Beer", Cb = cm });
        cm.DataSource = prodList;
        cm.DataBindings.Add("SelectedValue", prodList, "Code");
        Controls.Add(cm);
        cm.SelectedItem = null;
    }

    class Product
    {
        public ComboBox Cb;
        public string Code { get; set; }
        public string Name { get; set; }

        public string DisplayMember
        {
            get
            {
                if (Cb.DroppedDown)
                    return Code + " " + Name;
                else
                    return Code;
            }
        }
    }

    static void Main()
    {
        Application.Run(new testForm());
    }
}


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