Solved

Formatting variables in VB.NET

Posted on 2009-04-01
1
206 Views
Last Modified: 2012-05-06
formatting a textbox in VB

I need to format a textbox using Visual Studio, and VB.Net.

It needs to be formatted so that dates can be entered, for example, I was thinking this may work:

If textbox1.text <> dd/mm/yyyy Then Me.Close

... but it doesn't

-Will
0
Comment
Question by:r0yyyy
1 Comment
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 24038714
Its more like validation than formatting. If date is what your are looking to validate then use the datetimepicker control instead of textbox. Otherwise, there are many options such as regular expressions, masked textbox, parsing etc.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

705 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

20 Experts available now in Live!

Get 1:1 Help Now