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
3 answers

How to use a currency mask with three decimal places?

I'm using a class to format the value of my EditText to currency. This class use the function NumberFormat.getCurrencyInstance().format((parsed/100)); to format. This class make my value with two decmal places (R$2,00). I want it to have three…
Roland
  • 826
  • 2
  • 9
  • 24
0
votes
1 answer

Limit textfield input to number of columns / conflict with DocumentFilter

I have a WWFormattedTextField: public class WWFormattedTextField extends JFormattedTextField implements FocusListener { private DocumentFilter filter = new UppercaseDocumentFilter(); private boolean limitToMaxInput = false; public…
Metal Wing
  • 1,065
  • 2
  • 17
  • 40
0
votes
2 answers

What is causing text box with a MaskedEditExtender to duplicate characters?

I have a text box with a MaskedEditExtender. When I type in text, the output I get is jumbled with some numbers duplicated and others missing. If I remove the MaskedEditExtender, the textbox performs normally, but, of course, doesn't allow me to…
0
votes
2 answers

Set MaskedTextBox Value from the Right to Left

I currently have a mask of #9.99 The # is there for '+' or '-' sign. When I set the value of the Masked text box, where the value is negative it will give me the correct value. However when the value is positive it gives me the incorrect…
Dreamer78692
  • 215
  • 5
  • 20
0
votes
0 answers

DataGridViewMaskedTextColumn for DataGridView in Winforms

I am trying to mask DataGridView DateTime column, to achieve this I tried custom control made by J Thomas form codeproject Link; after adding in DataGridView and while trying to enter(keypress) datetime value i am getting below error…
Kumar Gaurav
  • 899
  • 5
  • 19
  • 35
0
votes
2 answers

Masked Text Box - Hide Mask

I'm using the WPF Extended Toolkit, and I want to know if it's possible to hide the mask, and then while the user is typing, the MaskedTextBox starts to mask the text. The default settings is to show the mask as text. For example, mask is …
Guilherme
  • 5,143
  • 5
  • 39
  • 60
0
votes
1 answer

Display caret position in textfield in Firefox or resize textfield as needed

There is an annoying bug in Firefox which allows me to set the caret position in a textfield, but it does not automatically scroll that caret into view. My particular issue arises when using the jQuery Masked Input Plugin…
Jonathan Hawkes
  • 953
  • 2
  • 12
  • 24
0
votes
3 answers

Zip code size test C#

I have a small piece of code that I have been trying to get to work, but nope. So I've come to the experts. I'm trying to test a zip code entry and limit it to 5 digits only. My first issue is with the attached code. It doesn't seem to be counting …
user2297683
  • 406
  • 1
  • 5
  • 15
0
votes
3 answers

How to only allow the numbers ,backspace key and hypen key to be pressed on textbox

I made a textbox to to insert a phone number . I only want numbers, delete button and hyphen key to be pressed. I used following code : It works for delete button and numbers , what shoud I do for hyphen? private void…
0
votes
1 answer

Xml Serialization of MaskedText Value Stored in Member String

//Update I've added the corrections and provided the Form1.c code in it's entirety. In the interest of Simplicity I've dumbed this down a bit. So all my form controls are set. Date as DateTimePicker(Short), Employee Number as…
0
votes
1 answer

display letter A in mask maskedtextbox

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…
Findus
  • 303
  • 1
  • 4
  • 17
0
votes
2 answers

Move cursor position

How to set the cursor position of a MaskedTextBox in VB.NET start from right? MaskedTextBox in my form is 5 digit numeric format.
Thanzeem
  • 133
  • 5
  • 13
  • 22
0
votes
1 answer

Checking empty controls in VB.NET

I want to check the controls in my Form is empty or not... I have a long code for that. I give code given below. Public totflag As Boolean Private Sub BTNSAVE_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BTNSAVE.Click …
Thanzeem
  • 133
  • 5
  • 13
  • 22
0
votes
2 answers

MaskedTextBox.Mask not working properly

I am using MaskedTextBox in my code to for a date field. When I am giving maskedTextBox1.Mask = "00/00/0000 00:00 AA" in code,on running the application in my machine it works fine and mask in the textbox appears as [_ _/_ _ _/____ __:__ _ _…
user1805377
  • 73
  • 1
  • 9
0
votes
1 answer

Set population field validation in masked text box

Hi I am new to C# I have one problem in masked text box Population range is 1,000 to 12,00,00,00,000 My problem is when enter 1000 in masked text box it will be taken as 1,000 like when i enter 12000 it will considered as 12,000 like default it…
rangasathish
  • 595
  • 6
  • 13
  • 25