473,793 Members | 2,948 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Masked Edit Box

63 New Member
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
Nov 21 '07 #1
7 2052
jamesd0142
469 Contributor
many people disagree with me, but i personally advise the mid function...

mid(string,star t character, length)

so capture first 7
Expand|Select|Wrap|Line Numbers
  1. dim str as string
  2. str = 9999999A
  3. dim a as string
  4. a = mid(str,1,7)
  5.  
Nov 21 '07 #2
Killer42
8,435 Recognized Expert Expert
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 (?).
Nov 22 '07 #3
AHMEDYO
112 New Member
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.SelStar t 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.
Nov 22 '07 #4
lotus18
866 Contributor
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 :

Expand|Select|Wrap|Line Numbers
  1. MaskedBox1.Mask = #######?
  2.  
Nov 22 '07 #5
MiziaQ
63 New Member
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.SelStar t 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 :)
Nov 22 '07 #6
lotus18
866 Contributor
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. : )
Nov 22 '07 #7
Killer42
8,435 Recognized Expert Expert
I think you're better off sticking with the masked edit control, rather than trying to do it yourself in a textbox.
Nov 22 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
9113
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 i set mskedbox1="08/30/2004", but I can't seem to get the date value into the box. I've even tried using format(date,"Short Date") to no avail. Format and mask properties of the box are set to ##/##/####
1
5514
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 the web form, when I select the control & see its properties, I do not see the "Text" property. I also try to set the "Text" property in a javascript function, but cannot access it. Here is the code:
1
2107
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 like to do the similar thing. The guide asks me to add Masked Edit Control to the Toolbox by adding Microsoft Masked Edit Control and I did it. However, there is no Mask property of this edit control box. Another is how declare this control.
1
1951
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 that the value of mskbanknum.text actually is "125"
1
3479
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 using the Data Form Wizard. Everything works fine. The problem is that I want to use the masked edit control to manage the way some fields appear, and are being stored to the database. I insert the "Microsoft Masked Edit Control, version 6.0" (Path...
3
2611
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 anybody have a clue, why these lines don' t work? I use vb.net 2002 Thank u
0
1034
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, in masked edit control, mask properties? i try on code but can't see the differences??
7
8703
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 does not seem to be appropriate for a desktop application with textboxes not bound to a dataset, am I wrong? -- How time fly's when you don't know what you are doing!
1
2093
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 position one tom provan
4
3177
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 don't know how to get the 'masked' information back to the 'unmasked' raw data that the database wants.
0
9518
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
10430
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
10211
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...
0
10000
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9033
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4111
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
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.