473,666 Members | 2,281 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MaskedTextbox - allow only certain letters

Can you make the MaskedTextbox to only allow certain letters e.g.

10:11 A

(Only allow A and P as input)
??
I don't want any other letters than A or P to appear in the text box. I mean
no post validation. Overriding the KeyPress function only allows me to
disallow the key pressed to appear (by setting e.KeyChar = (char) 0;), but it
doesn't allow me to see and test the complete string (I only can see the
characters input before the current key, which I don't know at which position
it is placed).
Mar 28 '08 #1
0 2059

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

Similar topics

0
1733
by: Mauricio C Vidotto | last post by:
I have an application that use MaskedTextBox Control. This control has Mask property value 9999999.99 and I would like to add numeric values with 2 decimal places. However, if I set Text property value " 12.34" the control show "1234 " align to left. How Can I format numeric values in MaskedTextBox Control?
0
1306
by: dumbo | last post by:
I do not succeed to modify the content of a MaskedTextBox control whose Property "OutputText" is in binding with field of type text of one table in database a MDB. The control has been generated making a drag-and-drop of the respective field from the window of the "Data Sources" of the plan and associating to same a control of the MaskedTextBox type to whose property "Mask" has been assigned the following string "00.00.00" (to represent a...
1
1733
by: Matt | last post by:
I recently came across what I believe to be a peculiar bug with Mdi Children, and wanted to see if anyone else had experienced this before sending it in. The issue is as follows: I have a number of forms set up as children of a single "Shell" MdiParent. In these, I have a number of databound masked textbox controls (for phone numbers, 9-digit zips, etc...). When I show the form the first time, the masks show up fine; however, if I hide...
2
6425
by: Jaime Rios | last post by:
Hi, I'm using C# to create a printable form. The data is coming from a XML source that I load when the application starts. I have no problems loading the data, but I am having a hard time figuring out the best way to display currency in a field. I can use a MaskedTextBox, but it doesn't work in every situation. Are there any good code samples to show how to resolve this display issue? Thanks in advance!
1
2068
by: Jazer | last post by:
Hi, I have a problem with MaskedtextBox. When I 'am trying to insert value 1.5 (single type) into MaskedTextBox, the value on it is shown as 15__,_. Mask is #90.9 The result should be ___1,5 Is anybody have ideas? P.S. Sorry for my english.
3
4997
by: Mike Fellows | last post by:
I have a few masked textboxes within my application and I have the same problem with each and everyone If I tab to a masked textbox i have no issues, but when i click into a mask textbox the problems arise. when i click in it places the cursor where i click (not at the start of the masked textbox), this forces users to either click back to the start of the textbox or hold the left arrow key to move back to the start
1
3805
by: Craig | last post by:
Hi, I have had a look on google groups for help on the MaskedTextBox and strings but every post I find seems to relate for formatting numbers. So, is it possible to set up a mask on the MaskedTextBox that would force the user to only enter alpha characters (A to Z) or am I condemned to overriding the KeyPress event? Thanks & regards,
1
9177
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
We have some dumb and lazy people here, so I need help. To fix the dumb part: We have placed MaskedTextBoxes on the forms so they will stop entering the information incorrectly. Now the lazy part: When our people click on a blank MaskedTextBox field, the cursor does not automatically go to the first "non-filled" mask value. For Example: Take the MaskedTextBox "___-___-___". When our people click the Text area, their cursor may stop...
1
4906
by: eljainc | last post by:
Hello, I am trying to utilize a MaskedTextBox control on my form. I would like the user to enter numbers only (i.e. 65000), I set the Mask property as 999999 and the PromptChar as space (it won't take a blank). However in my output the masked characters are replaced by spaces. How can I change this promptchar to a blank/empty value so that there are no spaces? Is there a more suitable control to use? Thanks
0
8443
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8356
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8866
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6192
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5663
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2769
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1772
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.