Solved

Removing mask out of maskedtextbox

Posted on 2014-11-16
3
119 Views
Last Modified: 2014-11-16
I need to remove the "/" out of the maskedtextbox.  I have found one solution and it returns a "False" value.

Dim casenumbernomask As String = txtCaseNumber.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals

Open in new window


The setup is like this: 14/11/2001

When it saves to the db, I need it to save like this: 14112001

Thanks in advance!
0
Comment
Question by:russell12
  • 2
3 Comments
 
LVL 34

Accepted Solution

by:
Dan Craciun earned 500 total points
ID: 40446178
Try this (untested):
Dim casenumbernomask As String = txtCaseNumber.Replace("/", "")

Open in new window

This assumes txtCaseNumber is your date with /.

HTH,
Dan
0
 
LVL 2

Author Comment

by:russell12
ID: 40446432
I have tried that and the error I get is:
'Replace' is not a member of 'System.Windows.Forms.MaskedTextBox'.
Thanks for responding!
Russell
0
 
LVL 2

Author Closing Comment

by:russell12
ID: 40446436
I have found the solution.  The issue is I do not dim casenumbernomask, instead I put :

txtCaseNumber.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals

Open in new window


I am giving you the points for responding and trying to help!!  Thanks again for your help!!!!

Russell
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…

821 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