We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

MaskedTextBox Binding problem

Thread ID:

Created:

Updated:

Platform:

Replies:

100406 Aug 4,2011 10:10 AM Aug 8,2011 11:07 AM WPF 1
loading
Tags: Tools
Richard Tang
Asked On August 4, 2011 10:10 AM

I two way bind DateTime value to the MaskedTextBox, but the value did not show up in the Box.

Text='{Binding Path=StartTime, StringFormat='{}{0:MM/dd/yyyy, hh:mm}'}'
Mask='00/00/0000, 00:00' Foreground='White'
LostFocus='MaskedTextBox_LostFocus' />




Michel Cossette
Replied On August 8, 2011 11:07 AM

Try binding the 'Value' instead of the 'Text' property, as:

Value='{Binding Path=StartTime, StringFormat='{}{0:MM/dd/yyyy, hh:mm}'}'
Mask='00/00/0000, 00:00' Foreground='White'
LostFocus='MaskedTextBox_LostFocus' />




CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;