This project has moved and is read-only. For the latest updates, please go here.

MaskedTextBox OnApplyTemplate problem

Sep 29, 2012 at 10:57 PM

MaskedTextBox has a bug hard to catch but easy to reproduce (well, it is easy now ;) ):

Put a TabContreol on the xaml, on the first tab put a button and on the second a maskedtextbox (with any mask). On the button click, set the masktextbox value. Now if you run the application and click the button *before* open Tab 2, the value gets setted on the control but when you open Tab 2, it gets reseted. If you open Tab2 before and then click the button, it works fine.

 

I found out that removing line 288 on MaskedTextBox.cs fixes this but I am not sure if there is a collateral effect.

 

public override void OnApplyTemplate()    
{     
      base.OnApplyTemplate();
      ResolveMaskProvider( Mask );      
      //UpdateText( 0 );    <-- commented this
}

Oct 1, 2012 at 3:21 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Nov 7, 2012 at 7:51 PM

Fixed in v1.8