?
Solved

Validate  a mask edit box.

Posted on 2004-10-18
1
Medium Priority
?
350 Views
Last Modified: 2010-04-23
I have a mask edit box for the purpose of entering a time, i.e. "10:15"

In Properties of the mask edit box,
Format is hh:mm
Mask is ##:##
It appears as this "__:__" on my form.

On a certain button click (calculate, to be precise), I want to verify that the user entered a time and did not just skip over that field leaving it blank.

The following three code-attempts do not work:
If mskTimeOut.Text = "##:##" Then
            MessageBox.Show("Please enter rental time out")
            mskTimeOut.Focus()
End If

If mskTimeOut.Text = "" Then
            MessageBox.Show("Please enter rental time out")
            mskTimeOut.Focus()
End If

If mskTimeOut.Text = "__:__" Then
            MessageBox.Show("Please enter rental time out")
            mskTimeOut.Focus()
End If

I have also tried to do a "textchanged" type of code, but it would not let me.

From what I am reading in my books and elsewhere on the internet about mask edit boxes, I gather that they are great for ensuring proper data entry format, but relatively useless for anything else.

Please tell me this is not true - there has to be a way to validate whether a user has entered into this box.
Thanks - A
0
Comment
Question by:veigea41
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 10

Accepted Solution

by:
123654789987 earned 1500 total points
ID: 12344745
Yes it is possible to validate a masked textbox. This is a good link where it has been implemented

http://www.c-sharpcorner.com/Code/2004/Jan/MaskedTextBoxControl.asp
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

762 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