User (Old forums)MemberMarch 27, 2008 at 10:53 amPost count: 23064
I am using a a masked text box to display a percent value
I get underlines in the blank spaces. For example “5 %” displays as “__5 %”
is there anyway I can get rid of the underlines when this value is displayed?
Imported from legacy forums. Posted by Ben (had 3148 views)Xceed SupportMemberMarch 28, 2008 at 5:37 pmPost count: 5658
Change the PromptChar property to the value you want.
Imported from legacy forums. Posted by Jenny [Xceed] (had 3171 views)User (Old forums)MemberOctober 29, 2008 at 6:46 amPost count: 23064
the problem is if i set the PromptChar=”” to empty, then the quadrat character is shown and the entered text with the quadrats is saved to the bound DataTable as well.
how can i avoid this behaviour?
Imported from legacy forums. Posted by noname (had 1669 views)User (Old forums)MemberOctober 30, 2008 at 10:21 amPost count: 23064
I guess that what Jenny meant was to set the PromptChar to a ‘ ‘ (a space).
However, a much better way to achieve what you want would be to simply set the MaskedTextBox’ HidePromptOnLeave property to True.
Imported from legacy forums. Posted by PL (had 866 views)User (Old forums)MemberOctober 31, 2008 at 4:41 amPost count: 23064
Thanks, the HidePromptOnLeave works if i leave the editor before saving the DataTable.
if i press enter while i am in editing mode of the maskedtextbox, then the table is saved (rowchanged event of the datatable) before the editor has been left and the prompt is saved as well – same problem.
can i somehow force to leave the maskedtextbox editor before rowchanged is called?
Imported from legacy forums. Posted by noname (had 673 views)User (Old forums)MemberNovember 3, 2008 at 9:22 amPost count: 23064
There is no way I can think of to force the MaskedTextBox to lose keyboard focus earlier.
I noticed that you set your MaskedTextBox ValueDataType to Decimal… is your underlying DataTable using a Decimal column ? If so, you could bind the Value property of MaskedTextBox instead of Text.
If that’s not the case, and for some reason you are storing the percent value as a string, then another possible solution might be to set the ValueDataType to String and use the QueryValueFromText event to set the value to the unmasked text.
You can format the maskedText as you want by using the MaskedTextBox MaskedTextProvider property. This returns the Microsoft’s MaskedTextProvider mask engine on which you can call one of the many overloads of ToString to obtain the masked or unmasked string formatted as you like.
Imported from legacy forums. Posted by PL (had 1831 views)
- You must be logged in to reply to this topic.