In my project I need the user to type in the following input:
9999999A
where the first 7 digits must be only digits,
and the last character must be a letter from a-z ONLY
I am using # for the first 7 digits,
which character do I have to use to allow to enter only letters ?
Thanks in advance :)
MiziaQ
7 2036
many people disagree with me, but i personally advise the mid function...
mid(string,start character, length)
so capture first 7 -
dim str as string
-
str = 9999999A
-
dim a as string
-
a = mid(str,1,7)
-
many people disagree with me, but i personally advise the mid function...
Sorry James, but I think you misunderstood the question. MiziaQ, according to the documentation you use a question mark ( ?).
HI..
i think that you can use Key_Press Event to control what type of charatcers user can input asscoiated by Length of your TextBox Control and TextBox.SelStart Property, for example you can allow only digits if the textbox length less than 7 and allow characters from a-z if the length=7 and selstart=6, you can try something like that
Best Regards
Edit : sorry i was have miss understand about your question, wrong answer.
In my project I need the user to type in the following input:
9999999A
where the first 7 digits must be only digits,
and the last character must be a letter from a-z ONLY
I am using # for the first 7 digits,
which character do I have to use to allow to enter only letters ?
Thanks in advance :)
MiziaQ
If you're using MaskedBox try this : -
MaskedBox1.Mask = #######?
-
HI..
i think that you can use Key_Press Event to control what type of charatcers user can input asscoiated by Length of your TextBox Control and TextBox.SelStart Property, for example you can allow only digits if the textbox length less than 7 and allow characters from a-z if the length=7 and selstart=6, you can try something like that
Best Regards
Edit : sorry i was have miss understand about your question, wrong answer.
Hey, could you please give me the code example for that. It would help a great deal :)
Hey, could you please give me the code example for that. It would help a great deal :)
Don't ask for a code. Just try to do it with your own. If you have some questions regarding about your code that's the time you can ask for our help. : )
I think you're better off sticking with the masked edit control, rather than trying to do it yourself in a textbox.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Eric Kiernan |
last post by:
I have a masked edit box which has a value of "8/30/2004", and when i
programically set the value to mskedbox1=date, the vb blows up with an
invalid property value error. any ideas? It works ok if...
|
by: metridevkk |
last post by:
Hi,
I need to use a Masked Edit Control in my ASPX page. In VS.Net, I added the
reference to MSMask.dll for my application & also added the MaskEdBox to the
Toolbox.
After adding the control to...
|
by: david |
last post by:
Anybody could give me hint how use this control in asp.net web form.
The problem is:
I try to use COM component in my web form app by using MS training kit for
windows form application. I would...
|
by: larry |
last post by:
hi,
using the masked edit control in vb.net, I have a control
named
mskbanknum
when i set
mskbanknum.text = "125"
the value "125" is not displayed in the vb.net form
the debugger verify's...
|
by: Kostis |
last post by:
Hello there!
I have created a windows application in VB.NET and I want to retrieve
data from an access database. I create the OleDbConnection, an
OleDbAdapter, a dataset and finally a Data Form...
|
by: Panos |
last post by:
Hi all,
I can't clear a Masked edit control. I use it to input dates, so I have
defined the mask as "##/##/####". I use the the well known
meb.mask=""
meb.text="" ,
but nothing happens.
Does...
|
by: jin |
last post by:
Hi, i sa wthe textbook said, # is a digit place holder which entry required
while 9 is a digit place holder which entry optional
actually what is the meaning of entry optional and entry required,...
|
by: DazedAndConfused |
last post by:
Curently I manualy code keypress edits. i.e. allow only 3 digits before
decimal and two digits after decimal in .NET.
Is there an easy solution to mask text boxes?
The MSMASK32.OCX from vb6...
|
by: tom provan |
last post by:
When I use the masked edit box, I can tab to it and the cursor will go to the start of the box.
However if I click on it the cursor goes to wherever I clicked.
How can I make a click go to start...
|
by: mwcapps |
last post by:
I have unformatted text in my SQL 2005 database. I'm pulling it into a masked edit text box with a (999)999-9999 mask. Unfortunately, when I attempt to save the data back it doesn't work because I...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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,...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |