Questions tagged [maskedtextbox]

A useful .NET control that allows a user to display and edit values based on the mask defined.

The MaskedTextBox class is a .NET/Windows Forms enhanced TextBox control that supports a declarative syntax for accepting or rejecting user input.

For example, in order to get a phone number in the format (505) 55 555 555, MaskedTextBox is preferred.

Using the Mask property, you can specify the following input without writing any custom validation logic in your application:

  • Required input characters.

  • Optional input characters.

  • The type of input expected at a given position in the mask; for example, a digit, or an alphabetic or alphanumeric character.

  • Mask literals, or characters that should appear directly in the MaskedTextBox; for example, the hyphens (-) in a phone number, or the currency symbol in a price.

  • Special processing for input characters; for example, to convert alphabetic characters to uppercase.

For more information, see MaskedTextBox Class (MSDN).

261 questions
0
votes
1 answer

How can I resolve maskedInput error: Object doesn't support property or method 'mask'?

Tools jquery.maskedinput-1.3.min.js (DigitalBush) Visual Studio 2012 SP1 .NET Framework 4.5 MVC Runtime v4.0.30319 Windows 7 IE 9 64-bit jquery/1.7.1/jquery.min.js The full panoply of References MS supplies with a new Web MVC project Issue I had…
Arnold
  • 515
  • 1
  • 9
  • 18
0
votes
1 answer

Dynamically adding a mask to textbox input in google app script?

How can I dynamically add a mask to the textbox input in google app scripts? I have a textbox that is intended to get a date, but I want the script to add the slash (/) by itself. For example: the user enters "01022009" and dynamically the script…
user2533794
0
votes
2 answers

Masked text box search and sql query

I have a masked textbox in c# winform. The masking would be like - (two numbers on the front and 4 number on the right after the dash). for ex: 12-3456 There are more permutations like - (3 spaces on the front and 5 on the right) for ex:…
Sharpeye500
  • 8,775
  • 25
  • 95
  • 143
0
votes
2 answers

Percentage in maskedTextBox display improperly

I'm trying to display a percentages in a MaskedTextBox the string being passed in its "40.99" but when it displays on the form it is "409.9%". populating value if (_person.Percentage != null) maskedTextBoxPercentage.Text =…
Antarr Byrd
  • 24,863
  • 33
  • 100
  • 188
0
votes
1 answer

Devex TextEdit Input Mask Regex for US Phone Numbers

I'm using a Devex TextEdit control in a WInForms application. I want to use a regular expression mask on the control for formatting US phone numbers. I'm currently using this: ((\d{3}))-(\d{3})-(\d{4}) x(\d*) (888) 555-1212 x235 I want to make the…
Paul Perrick
  • 496
  • 9
  • 22
0
votes
1 answer

How can I add mask textbox control in DataGridView in windows C#?

I want to add Mask textbox in datagridview in windows application. The mask textbox will hold the mask for time value. How this can be done in the windows datagridview? Any help?
Dhanapal
  • 14,239
  • 35
  • 115
  • 142
-1
votes
1 answer

C# display / (forward slash) in MaskedTextBox

I noticed that when the mask defined for input in a MaskedTextBox contains "/", it is automatically substituted by "-" in the textbox. I tried this using the default Date format available in VS, which in the form's Designer results in the following…
-1
votes
2 answers

MaskedTextBox for ID number with leading zeros

I've created a WinForm that has a field for an employee or student ID number. All ID numbers are 9 digits long with 2 leading zeroes (ex. 001234567). How can I configure the text mask to validate the user's input and require leading zeros but…
-1
votes
2 answers

How to handle an event for TextBox and MaskTextBox without InvalidCastException?

Any buddy please correct my script, TextBox variable working done but MaskTextBox Returning error in this EnterEvent. I want to use one Function of event-handling for TextBox and MaskTextBox Private Sub TextBox_Enter(sender As Object, e As…
-1
votes
3 answers

Textbox Number Formating & start with zero & accept only Numbers

I am using below Property example to make some calculation on textbox and if textbox is null I am assigning zero to it so calculation won't fail as you can see I am using Math.Round and I want to make several checks on these textbox input like…
sam
  • 2,493
  • 6
  • 38
  • 73
-1
votes
1 answer

MaskedTextBox detecting a tab

I have a MaskedTextBox that formats text to look like (###) ###-#### After entering the first 3 digits, they like to press "TAB" to the next set. Unfortunately by pressing TAB, they are in the next field. So my boss asked me to modify the…
software is fun
  • 7,286
  • 18
  • 71
  • 129
-1
votes
1 answer

vb.net masked textbox and datetime now string not working together?

I have a masked textbox set to date.short I would like to automate the cuurentdate to be filled in when the masked textbox is clicked I though the following would work but I get the error InvalidCastExpectation was ungandeld "Application is in break…
LabRat
  • 1,996
  • 11
  • 56
  • 91
-1
votes
1 answer

maskedTextBox in windows form application

In windows form application, C# using Visual Studio 2012 My mask is 0.00 but when I enter 3.00 it consider just 3 not 3.00 and also when enter 3.30 it consider 3.3 but if I enter 3.01 then this value being considered. problem is I want that it…
REHAN
  • 1
-1
votes
3 answers

C# - How to Change Dynamically the Mask of the MaskedTextBox?

Here's the problem: I'm using a MaskedTextBox for phones masks. But, the Mask must accept two kinds of mask, like, the default mask is like this (00) 0000-0000, but sometimes the mask need to have one more slot, like this (00) 0000-00000. This…
APS
  • 23
  • 1
  • 2
  • 5
-1
votes
1 answer

how can i split the values of a masked text box in c#

I have a masked textbox which dispalys time.I want to get the hour and minute of the time in two seperate variables. how can i do this. I have tried something like this. float m = maskedTextBox1.SelectionStart; MessageBox.Show(m.ToString());
Henna
  • 1
  • 7
1 2 3
17
18