maskedtextbox

How to apply formatting string when binding DateTime to MaskedTextBox?

淺唱寂寞╮ 提交于 2019-12-23 02:48:10
问题 I have a MaskedTextBox using the mask "00/00/\2\000" to restrict input to a format of XX/XX/20XX , with the Text property bound to MyBindingSource.SomeProperty of type DateTime . Recently, values with a single-digit month or day recently started displaying incorrectly. I expect that the ToString() method is being called on the value at some point in data binding, and I believe the call is not padding month / day with zeroes. I tried setting the format type of the MaskedTextBox.Text property

Adding a format to the TextBox in asp.net [closed]

本小妞迷上赌 提交于 2019-12-21 20:15:32
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I need to format an asp.net text box in such a way that it accepts the user input only in the form of ### - ### - ### (#:numerics only

masked input not working in android mobiles?

这一生的挚爱 提交于 2019-12-17 18:33:16
问题 I am using the digitalbush masked input jQuery plugin. It is working fine in web browsers and the iPhone browser perfectly, but it is not working for Android mobile devices. My issue : mask is in input field _ - _ - ___. When I type numbers it will 12345685555___- - Example: http://rossbender.com/temp/mask.html Any suggestions? How can I solve this? Thanks Prasad. 回答1: I resolved this issue with three actions, which have fixed this for all Android 4.0+ phones: Update masked-input to at least

Windows Forms: Unable to Click to Focus a MaskedTextBox in a Non TopLevel Form

瘦欲@ 提交于 2019-12-17 14:15:48
问题 Like the title says, I've got a Child form being shown with it's TopLevel property set to False and I am unable to click a MaskedTextBox control that it contains (in order to bring focus to it). I can bring focus to it by using TAB on the keyboard though. The child form contains other regular TextBox controls and these I can click to focus with no problems, although they also exhibit some odd behavior: for example if I've got a value in the Textbox and I try to drag-click from the end of the

MaskedTextBox Minimum/Maximum Lengths

若如初见. 提交于 2019-12-13 21:45:24
问题 I have a masked textbox with the need to have a min/max length set on them. When these conditions are met a button becomes enabled. I was thinking of handling the TextChanged event to determine the length of the entered text and set the buttons enabled value. Is there a better approach? btnOK.Enabled = txtDataEntry.Text.Length >= MinDataLength && txtDataEntry.Text.Length <= MaxDataLength; 回答1: Which approach could be even simpler than what you are suggesting? myTextBox.Textchanged+=(s,o)=>{

WinForms MaskedTextBox to accept certain chars

大城市里の小女人 提交于 2019-12-13 18:38:26
问题 I have a MaskedTextBox that accepts alpha numeric chars but I also want to accept brackets "()". How can I change the mask to accepts brackets also? 回答1: See this answer to a similar question: How to set Regex Expression as the Mask for a MaskedTextBox in C#? Instead of using a mask, you should probably just use regular validation, and then you can use the regular expressions directly. Make sure that the CausesValidation property of the (regular, not masked) textbox is true, then intercept

Getting Literal Value from a Masked Text Box Input

荒凉一梦 提交于 2019-12-13 17:42:59
问题 I've set up a Telerik RadMaskedTextBox with a Mask of "####-####". The problem is, when I later grab the value from this box it returns as "########". I'm unfamiliar with MaskedTextBoxes but I'm guessing that this is the default way it's supposed to return my value. How can I set the "-" as a literal character in the RadMaskedTextBox so it returns the whole value? ex. "1234-5678" instead of "12345678" 回答1: Use TextWithLiterals instead of Text property. 回答2: I'm unfamiliar with the Telerik

display letter A in mask maskedtextbox

妖精的绣舞 提交于 2019-12-13 07:05:08
问题 i am just thinking about how to display a letter in a maskedtextbox in VS .net 4. I can set up all letters, except an 'A' because it is used as a dummy for alphanumeric letters in in the mask. I want to display the unity "Ampere" in the mask after the value. Thank you. 回答1: Use backslash to escape special characters. \A will do what you want. http://msdn.microsoft.com/en-us/library/system.windows.forms.maskedtextbox.mask.aspx 来源: https://stackoverflow.com/questions/15114466/display-letter-a

TextBox.SelectAll() does not work with TAB

杀马特。学长 韩版系。学妹 提交于 2019-12-13 05:23:01
问题 I am using maskedTextBox.SelectAll() to highlight the text in the MaskedTextBox in the Enter and MouseDown events. It works when I use the mouse, but I go to that textbox by pressing the Tab key, it does not work. What am I missing here? 回答1: Have you tried the GotFocus event? When you change the focus by using the keyboard (TAB, SHIFT+TAB, and so on), by calling the Select or SelectNextControl methods, or by setting the ContainerControl.ActiveControl property to the current form, focus

ASP.NET AJAX Controls in MVC3?

左心房为你撑大大i 提交于 2019-12-12 20:44:47
问题 How would I use the ASP.NET AJAX Controls in MVC3? e.g. Masked Edit Box I've installed AJAX Control via NUGET. and tried adding Register TagPrefix="asp" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" to the top of the page. but it is not recognised. And I wonder if its even possible in MVC3 since Ive Never used the toolbar. It would make life so much easier If I could use these tools. 回答1: Any ASP.NET server control is meant to be used in Webforms, not in MVC. You'll have to