maskedtextbox

Masking Textbox to accept only decimals

老子叫甜甜 提交于 2019-12-02 15:03:32
问题 I am using the technique from this link to mask my textbox to accept strings that are in decimal-format (Digits with a single period). How to define TextBox input restrictions? Here is the regex I put in the mask: b:Masking.Mask="^\d+(\.\d{1,2})?$" For some odd reason, it lets me input the digits but I cannot insert the period in my textbox. I've also validated the regex here so regex is definitely correct. http://derekslager.com/blog/posts/2007/09/a-better-dotnet-regular-expression-tester

Masking Textbox to accept only decimals

给你一囗甜甜゛ 提交于 2019-12-02 09:35:19
I am using the technique from this link to mask my textbox to accept strings that are in decimal-format (Digits with a single period). How to define TextBox input restrictions? Here is the regex I put in the mask: b:Masking.Mask="^\d+(\.\d{1,2})?$" For some odd reason, it lets me input the digits but I cannot insert the period in my textbox. I've also validated the regex here so regex is definitely correct. http://derekslager.com/blog/posts/2007/09/a-better-dotnet-regular-expression-tester.ashx What could be the issue? Modify your regex with this: ^\d+([\.\d].{1,2})?$ DEMO EDIT: The above

How to set Regex Expression as the Mask for a MaskedTextBox in C#?

懵懂的女人 提交于 2019-12-01 21:42:01
I want to set the Mask of MaskedtextBox from Regex expression. Such as i want a valid email, Decimal values and other regex expressions against a MaskedtextBox. For reference, this describes what you can do with a mask: http://msdn.microsoft.com/en-us/library/system.windows.forms.maskedtextbox.mask(VS.90).aspx The only time I could see you needing to set the mask from a regular expression is if you don't have control over the regular expression, for example if it's acquired from the user or from a database. Masks are in a different format than regular expressions and aren't as powerful. So

Javascript event subscription after UpdatePanel async postback

只愿长相守 提交于 2019-12-01 21:22:36
问题 I Have a problem with jquery event handler after async postback on asp.net page. I read this topic - it's a good solution, but I need a separate function. So I'm using jquery masked plugin. My js code now is: <script type="text/javascript"> jQuery(document).ready(function () { var control = $("#txtCustomerPhone"); InitPhonePattern(this, control); var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_endRequest(InitPhonePattern(this, control)); }); function InitPhonePattern(sender,

How to get raw text from MaskedTextBox?

南笙酒味 提交于 2019-12-01 20:47:22
I have a MaskedTextBox with this mask (999) 999 9999. When user inputs a number the text property would give this to me : (0881) 444 5445 But I want to save the raw text to database field like this: 08814445445 . How can I do that? Based on what I found here you can set the TextMaskFormat -Property to MaskFormat.ExcludePromptAndLiterals . That should be you solution. The MaskFormat -Enumeration holds some "options" for the MaskedTextBox. They are: ExcludePromptAndLiterals Return only text input by the user. IncludeLiterals Return text input by the user as well as any literal characters defined

How to use built-in editors for a exposed properties in User Controls - Mask Property Editor Issue

我只是一个虾纸丫 提交于 2019-12-01 06:30:49
I think there is a simple solution for my stupid question but I just can't solve it today. I have a User Control that has a MaskedTextBox Control in itself. I have also exposed a few of its properties for the user to modify. One of these properties is Mask property which I want to expose with the ability of starting an editor with predefined values like in a normal MaskedTextBox control. So I created a public property InputMask and set up everything so that it can work but after showing the editor, I get an error dialog which contains this error: Object reference not set to an instance of an

Is it possible to use KnockoutJS with a masked input?

回眸只為那壹抹淺笑 提交于 2019-11-30 12:15:48
问题 I´m using that plugin : https://github.com/plentz/jquery-maskmoney to format my money editor... I tried to use KnockoutJS in that editor, but it does not work... Without that mask all works fine... My code test is simple : <input id="Price" data-bind="value: Price" type="text" name="Price"> Javascript to Mask input $("#Price").maskMoney({ symbol: 'R$ ', showSymbol: true, thousands: '.', decimal: ',', symbolStay: false }); And KnockoutJS var ViewModel = function () { this.Price = ko.observable

Is it possible to use KnockoutJS with a masked input?

送分小仙女□ 提交于 2019-11-30 02:22:44
I´m using that plugin : https://github.com/plentz/jquery-maskmoney to format my money editor... I tried to use KnockoutJS in that editor, but it does not work... Without that mask all works fine... My code test is simple : <input id="Price" data-bind="value: Price" type="text" name="Price"> Javascript to Mask input $("#Price").maskMoney({ symbol: 'R$ ', showSymbol: true, thousands: '.', decimal: ',', symbolStay: false }); And KnockoutJS var ViewModel = function () { this.Price = ko.observable(); this.PriceFinal= ko.computed(function () { return this.Price() }, this); }; ko.applyBindings(new

DataGridView Masked TextBox Column

二次信任 提交于 2019-11-29 17:10:17
I have a DataGridView with 2 columns,and i wanted to create some kind of input mask to it. So i found a small class that inherits maskedtextbox control and lets you use it in a datagridview. Everything works fine,the mask works as intended, no big deal. heres the library: http://www.codeproject.com/Articles/26005/DataGridViewColumn-Hosting-MaskedTextBox My problem is,once the row has all the data i need,pressing enter or tab does not create a new row, even tho i have datagridview1.AllowUserToAddRows = true. Then i found out the problem was in the library i linked,because when i add a simple

DataGridView Masked TextBox Column

江枫思渺然 提交于 2019-11-28 10:29:46
问题 I have a DataGridView with 2 columns,and i wanted to create some kind of input mask to it. So i found a small class that inherits maskedtextbox control and lets you use it in a datagridview. Everything works fine,the mask works as intended, no big deal. heres the library: http://www.codeproject.com/Articles/26005/DataGridViewColumn-Hosting-MaskedTextBox My problem is,once the row has all the data i need,pressing enter or tab does not create a new row, even tho i have datagridview1