[Mono-bugs] [Bug 424267] New: DateTimePicker: Space bar does not toggle checkbox

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Sep 8 06:03:58 EDT 2008


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


           Summary: DateTimePicker: Space bar does not toggle checkbox
           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, run code, press space bar

Observed: checkbox is not cleared

Expected: checkbox must be cleared

Code:

using System;
using System.Windows.Forms;

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

class ReportDialogForm : Form
{

    public ReportDialogForm()
    {
        Controls.Add(new MyDateTimePicker());
        var tb = new TextBox();
        tb.Top = 30;
        Controls.Add(tb);
    }

    class MyDateTimePicker : DateTimePicker
    {
        public MyDateTimePicker()
            : base()
        {
            MinDate = new DateTime(1900, 1, 1);
            MaxDate = DateTime.Today;
            Format = DateTimePickerFormat.Short;
            ShowCheckBox = true;
        }

        public new DateTime? Value
        {
            get
            {
                if (!this.Checked)
                    return null;
                return base.Value;
            }

            set
            {
                if (value != null)
                {
                    base.Value = (DateTime)value;
                    Checked = true;
                }
                else
                {
                    base.Value = DateTime.Today.AddDays(1);
                    base.Value = DateTime.Today;
                    Checked = false;
                }
                base.OnValueChanged(EventArgs.Empty);
            }
        }
    }
}


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