MaskedTextBox mask problem
-
Hi All! I have a problem that I can't find the solution of: In an application I'm using MaskedTextBox controls for dates (displaying current value and letting user change value). Default language for application is Swedish and mask is 0000-00-00 (for yyyy-MM-dd). This works fine. The application is also to be run in Finnish and then I set the mask to 00.00.0000 (for dd.MM.yyyy), this does not work at all! The mask is correct but for a reason beyond my comprehension in the text-property of the control the "." (dot) is replaced with "," (comma). I have tried to replace the comma, to overwrite the text property and a number of other things but without success. Is the problem that the control interpretes the date as a number and replaces the dot with the NumberGroupSeparator and NumberDecimalSeparator of the MaskedTextBox.Culture? If so how do I get the control so interprete the date as a date? What can I do to make the MaskedTextBox to work with my Finnish dates??? Thanks! Chris
-
Hi All! I have a problem that I can't find the solution of: In an application I'm using MaskedTextBox controls for dates (displaying current value and letting user change value). Default language for application is Swedish and mask is 0000-00-00 (for yyyy-MM-dd). This works fine. The application is also to be run in Finnish and then I set the mask to 00.00.0000 (for dd.MM.yyyy), this does not work at all! The mask is correct but for a reason beyond my comprehension in the text-property of the control the "." (dot) is replaced with "," (comma). I have tried to replace the comma, to overwrite the text property and a number of other things but without success. Is the problem that the control interpretes the date as a number and replaces the dot with the NumberGroupSeparator and NumberDecimalSeparator of the MaskedTextBox.Culture? If so how do I get the control so interprete the date as a date? What can I do to make the MaskedTextBox to work with my Finnish dates??? Thanks! Chris
-
Hi All! I have a problem that I can't find the solution of: In an application I'm using MaskedTextBox controls for dates (displaying current value and letting user change value). Default language for application is Swedish and mask is 0000-00-00 (for yyyy-MM-dd). This works fine. The application is also to be run in Finnish and then I set the mask to 00.00.0000 (for dd.MM.yyyy), this does not work at all! The mask is correct but for a reason beyond my comprehension in the text-property of the control the "." (dot) is replaced with "," (comma). I have tried to replace the comma, to overwrite the text property and a number of other things but without success. Is the problem that the control interpretes the date as a number and replaces the dot with the NumberGroupSeparator and NumberDecimalSeparator of the MaskedTextBox.Culture? If so how do I get the control so interprete the date as a date? What can I do to make the MaskedTextBox to work with my Finnish dates??? Thanks! Chris
-
Hi, Have you read the MSDN notes for the Mask property? To me they suggest that the date separator / will be interpreted according FormatProvider. Alan.