473,324 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Mask in a TextBox

Can I set a mask to a TextBox? How?

Thank you very much
Nov 16 '05 #1
2 2959
Alberto,

You can't do this with the TextBox now. However, .NET 2.0 will
introduce a MaskedTextBox control which you can use.

For .NET 1.1, you will have to create a textbox and hook into the change
events to determine whether or not the text matches the mask.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Alberto" <al*****@nospam.es> wrote in message
news:OO**************@TK2MSFTNGP10.phx.gbl...
Can I set a mask to a TextBox? How?

Thank you very much

Nov 16 '05 #2
You might want to look at DataBinding too. Combining the Format and Parse
events can allow a flexibility to the behaviour of a TextBox. Ex: You can
easily add a dollar sign to the display of a float to make it a currency
using Format.

And you should be able to use the parse event to control what is actually
stored in your bound class.

gdbj

"Alberto" <al*****@nospam.es> wrote in message
news:OO**************@TK2MSFTNGP10.phx.gbl...
Can I set a mask to a TextBox? How?

Thank you very much

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: johnp | last post by:
Hi, Our Tech department updated users to Office 2003 this week. Now the input mask in one of the applications is showing up as: (###) ###-### The input mask wizard works correctly when I...
9
by: msnews.microsoft.com | last post by:
Hello. How can I set input mask for TextBox? Or can I use for mask input some other control?
2
by: msnews.microsoft.com | last post by:
Hello. How can I set input mask for TextBox in Windows Form? For example I want to mask (format) TextBox for inputing phone number like (999) 999-99-99. The TextBox must first show something like...
0
by: Christian | last post by:
Hi all, on a PocketPC 2003 dialog I want the user to enter an IP-Adress using a TextBox control. Within the TextBox control I would like to display an predefined input mask like xxx.xxx.xxx.xxx ...
2
by: Visual Systems AB \(Martin Arvidsson\) | last post by:
Hi! Is it possible to set a mask on a TextBox control? I want to limit the chars to be entered, in one box i want just numbers 0-9 and in another box i want to separate the areacode in a...
0
by: =?Utf-8?B?RGV2ZXJz?= | last post by:
I've successfully made the columns in a DataGridView format numbers correctly using the Format porperty. Now I'm trying to do the same with textboxes, but the Mask property doesn't work the same...
2
by: nussu | last post by:
Hi , I need to find a subnet mask number for a given IP Address number. I have two textbox's once enter the ip address in first textbox i need to get subnet mask number for that ip address in...
3
by: rudeman76 | last post by:
Hi, I have been trying to find the answer to this for a couple days now. What I have is a textbox (txtTime) that the user will enter a time into. What I want is that the user can only enter in...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.