Solved

Self-completing date textboxes

Posted on 2007-11-24
4
224 Views
Last Modified: 2013-11-27
Hello, I am porting an old Access / VBA application to Visual Basic .NET.

Access had a very useful function which I can't in .NET, the format/Input mask.
Basically if I put "dd/mm/yyyy" as format and "99/99/99;0;_" as input mask everything the user will have to do it to type something like "030579" (the control in the meanwhile will automatically show __/__/____ on the textbox) and the system will complete it for him: it will become 03/05/1979.

Is there anything similar in Visual Basic .Net?
0
Comment
Question by:Emanuele_Ciriachi
  • 2
  • 2
4 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 500 total points
Comment Utility
There is a .net control called MaskedTextBox, have you seen it?
http://msdn2.microsoft.com/en-us/library/system.windows.forms.maskedtextbox.aspx
0
 
LVL 1

Author Comment

by:Emanuele_Ciriachi
Comment Utility
Wow, looke exactly what I need!

Any chance that you can show me how to use it for my goal, e.g. to accept dates comprised only of 6 numbers?
I could do all of this by myself, in this case the answer would be good but not excellent.
0
 
LVL 1

Author Comment

by:Emanuele_Ciriachi
Comment Utility
Typo: looke --> looks
0
 
LVL 55

Expert Comment

by:Jaime Olivares
Comment Utility
Set the mask to: "00/00/0000" and the PromptChar to: "_"
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now