[Mono-bugs] [Bug 457370] New: MaskedTextBox: mask is displayed insted of last digit

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Dec 8 15:20:23 EST 2008


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


           Summary: MaskedTextBox: mask is displayed insted of last digit
           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.

Observed:  22 1_

Expected: 22 16


using System;
using System.Windows.Forms;

public static class AppMainEntry
{
    [STAThread]
    public static void Main()
    {
        Application.EnableVisualStyles();
        var f = new Form();
        var tb = new MaskedTextBox();
        var bindingSource = new BindingSource();

        var dataSource = new Customer() { Time = "22 16" };
        bindingSource.DataSource = dataSource;
        bindingSource.ResetBindings(false);

        tb.Mask = "99 99";
        tb.HidePromptOnLeave = true;
        tb.Enter += (sender, e) => (sender as MaskedTextBox).SelectAll();

        Binding binding = new Binding("Text", bindingSource , "Time");
        binding.NullValue = "";
        binding.DataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged;
        binding.FormattingEnabled = true;
        tb.DataBindings.Add(binding);

        f.Controls.Add(tb);
        Application.Run(f);
    }
}

class Customer
{
    public string Time { get; set; }
}


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