473,387 Members | 3,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Help Clearing data in MaskEditBox Control

I'm trying to clear text from a MaskEditBox control.

I thought the format to delete it was:

'clear the mask
mskName.Mask = ""
'clear the text
mskName.Text = ""
'reassign the mask
mskName.Mask = "##:## ??"
this doesn't seem to work... what am I doing wrong? Thanks.

Sep 13 '06 #1
8 1666
I don't think you need to clear the mask, you should be able to just
use
mskName.Text = ""

Thanks,

Seth Rowe

ja**********@gmail.com wrote:
I'm trying to clear text from a MaskEditBox control.

I thought the format to delete it was:

'clear the mask
mskName.Mask = ""
'clear the text
mskName.Text = ""
'reassign the mask
mskName.Mask = "##:## ??"
this doesn't seem to work... what am I doing wrong? Thanks.
Sep 13 '06 #2
Yeah, that didn't work either... actually... on all of my masked edit
boxes, it isn't recognizing the .text property as anything other than
"". Any ideas there? Thanks!
rowe_newsgroups wrote:
I don't think you need to clear the mask, you should be able to just
use
mskName.Text = ""

Thanks,

Seth Rowe

ja**********@gmail.com wrote:
I'm trying to clear text from a MaskEditBox control.

I thought the format to delete it was:

'clear the mask
mskName.Mask = ""
'clear the text
mskName.Text = ""
'reassign the mask
mskName.Mask = "##:## ??"
this doesn't seem to work... what am I doing wrong? Thanks.
Sep 13 '06 #3
Does it throw an error when you try to set the .Text property? Also,
have you tried stepping through the code to make sure that nothing is
interfering?

Thanks,

Seth

James wrote:
Yeah, that didn't work either... actually... on all of my masked edit
boxes, it isn't recognizing the .text property as anything other than
"". Any ideas there? Thanks!
rowe_newsgroups wrote:
I don't think you need to clear the mask, you should be able to just
use
mskName.Text = ""

Thanks,

Seth Rowe

ja**********@gmail.com wrote:
I'm trying to clear text from a MaskEditBox control.
>
I thought the format to delete it was:
>
'clear the mask
mskName.Mask = ""
'clear the text
mskName.Text = ""
'reassign the mask
mskName.Mask = "##:## ??"
>
>
this doesn't seem to work... what am I doing wrong? Thanks.
Sep 13 '06 #4
I've stepped through about 15 times.... I can't figure it out, but I'm
gonna go into my professor today. Tahnks for the help though.
rowe_newsgroups wrote:
Does it throw an error when you try to set the .Text property? Also,
have you tried stepping through the code to make sure that nothing is
interfering?

Thanks,

Seth

James wrote:
Yeah, that didn't work either... actually... on all of my masked edit
boxes, it isn't recognizing the .text property as anything other than
"". Any ideas there? Thanks!
rowe_newsgroups wrote:
I don't think you need to clear the mask, you should be able to just
use
mskName.Text = ""
>
Thanks,
>
Seth Rowe
>
ja**********@gmail.com wrote:
I'm trying to clear text from a MaskEditBox control.

I thought the format to delete it was:

'clear the mask
mskName.Mask = ""
'clear the text
mskName.Text = ""
'reassign the mask
mskName.Mask = "##:## ??"


this doesn't seem to work... what am I doing wrong? Thanks.
Sep 13 '06 #5
Let me know what you find out, it's got me curious.

Thanks,

Seth

James wrote:
I've stepped through about 15 times.... I can't figure it out, but I'm
gonna go into my professor today. Tahnks for the help though.
rowe_newsgroups wrote:
Does it throw an error when you try to set the .Text property? Also,
have you tried stepping through the code to make sure that nothing is
interfering?

Thanks,

Seth

James wrote:
Yeah, that didn't work either... actually... on all of my masked edit
boxes, it isn't recognizing the .text property as anything other than
"". Any ideas there? Thanks!
rowe_newsgroups wrote:
I don't think you need to clear the mask, you should be able to just
use
mskName.Text = ""

Thanks,

Seth Rowe

ja**********@gmail.com wrote:
I'm trying to clear text from a MaskEditBox control.
>
I thought the format to delete it was:
>
'clear the mask
mskName.Mask = ""
'clear the text
mskName.Text = ""
'reassign the mask
mskName.Mask = "##:## ??"
>
>
this doesn't seem to work... what am I doing wrong? Thanks.
Sep 13 '06 #6
ok, i've got an update....

to clear the mskeditbox you have to:
mskName.Mask = " "
'there must be a space
mskName.Text = " "
mskName.Mask = "#####"

but it's weird because it still doesn't register the mask.text to have
anything in it.... anyone have any ideas? Thanks.

rowe_newsgroups wrote:
Let me know what you find out, it's got me curious.

Thanks,

Seth

James wrote:
I've stepped through about 15 times.... I can't figure it out, but I'm
gonna go into my professor today. Tahnks for the help though.
rowe_newsgroups wrote:
Does it throw an error when you try to set the .Text property? Also,
have you tried stepping through the code to make sure that nothing is
interfering?
>
Thanks,
>
Seth
>
James wrote:
Yeah, that didn't work either... actually... on all of my masked edit
boxes, it isn't recognizing the .text property as anything other than
"". Any ideas there? Thanks!
rowe_newsgroups wrote:
I don't think you need to clear the mask, you should be able to just
use
mskName.Text = ""
>
Thanks,
>
Seth Rowe
>
ja**********@gmail.com wrote:
I'm trying to clear text from a MaskEditBox control.

I thought the format to delete it was:

'clear the mask
mskName.Mask = ""
'clear the text
mskName.Text = ""
'reassign the mask
mskName.Mask = "##:## ??"


this doesn't seem to work... what am I doing wrong? Thanks.
Sep 14 '06 #7
and I figured the rest out... ok

the .text property is not recognized by the mskeditbox so you must use
the .seltext but you must follow this format:

mskZip.SelStart = 0
mskZip.SelLength = Len(mskZip.Mask)
strZip = mskZip.SelText

James wrote:
ok, i've got an update....

to clear the mskeditbox you have to:
mskName.Mask = " "
'there must be a space
mskName.Text = " "
mskName.Mask = "#####"

but it's weird because it still doesn't register the mask.text to have
anything in it.... anyone have any ideas? Thanks.

rowe_newsgroups wrote:
Let me know what you find out, it's got me curious.

Thanks,

Seth

James wrote:
I've stepped through about 15 times.... I can't figure it out, but I'm
gonna go into my professor today. Tahnks for the help though.
>
>
rowe_newsgroups wrote:
Does it throw an error when you try to set the .Text property? Also,
have you tried stepping through the code to make sure that nothing is
interfering?

Thanks,

Seth

James wrote:
Yeah, that didn't work either... actually... on all of my masked edit
boxes, it isn't recognizing the .text property as anything other than
"". Any ideas there? Thanks!
rowe_newsgroups wrote:
I don't think you need to clear the mask, you should be able to just
use
mskName.Text = ""

Thanks,

Seth Rowe

ja**********@gmail.com wrote:
I'm trying to clear text from a MaskEditBox control.
>
I thought the format to delete it was:
>
'clear the mask
mskName.Mask = ""
'clear the text
mskName.Text = ""
'reassign the mask
mskName.Mask = "##:## ??"
>
>
this doesn't seem to work... what am I doing wrong? Thanks.
Sep 14 '06 #8
Hello james,
I'm trying to clear text from a MaskEditBox control.

I thought the format to delete it was:

'clear the mask
mskName.Mask = ""
'clear the text
mskName.Text = ""
'reassign the mask
mskName.Mask = "##:## ??"
this doesn't seem to work... what am I doing wrong? Thanks.
Since you are refering to the MaskEditBox, I assume you are working with
VB6 as the 2005 version is the MaskedTextBox. If it is the VB6 version, you
may want to try one of the VB6 groups. FWIW, here's the code I used on my
wrapped box:

Public Property Let Text(ByVal New_Text As Variant)
Dim stMask As String
'clear out old value
mflgLoading = True
stMask = MaskEdBox1.Mask
MaskEdBox1.Mask = ""
MaskEdBox1.Text = ""
MaskEdBox1.Mask = stMask
'put data in box
If IsNull(New_Text) = False Then
Select Case stMask
Case "##/##/####", "&&/&&/&&&&"
MaskEdBox1.SelText = Format(New_Text, "mm/dd/yyyy")
Case Else
MaskEdBox1.SelText = New_Text
End Select
End If
PropertyChanged "Text"
mflgLoading = False
RaiseEvent Change
End Property

My full sample is available at http://avbsg.net/Uploads/JW071801.exe. (note,
this is actually a zip file not exe. You will need to change the extension
in order for it to extract properly).

Jim Wooley
http://devauthority.com/blogs/jwooley/default.aspx
Sep 14 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jeff Levinson [mcsd] | last post by:
Not as far as I know. The easiest way is just to create a loop to set all of the controls values to "". You'll probably have to use a typeof statement to come up with specific clearing methods for...
8
by: Foxy Kav | last post by:
Hi everyone, Im currently doing first year UNI, taking a programming course in C++, for one project i have to create a simple array manipulator... that i have done, but i cant figure out how to...
2
by: Savvas | last post by:
Hi everybody, I have a lot of textboxes on my form and a "Clear" button. Is there a way with a for loop or something to clear the textboxes, instead of writing textboxName.clear? Thanks a lot
7
by: BBFrost | last post by:
I'm receiving decimal values from database queries and placing them on a report page. The users want to see the following .... Db Value Display Value 123.3400 123.34...
5
by: Alien2_51 | last post by:
I have a problem with a ListBox control that is on a TabControl, it seems to be forgetting which items are selected in the list when I tab off the current tab, here's my winform code... I even...
7
by: Peter Row | last post by:
Hi, I've started work on my own control some parts of which use standard controls, others I need to draw on my controls surface to get the display output I require, however.... I seem to be...
32
by: robert d via AccessMonster.com | last post by:
I'm looking at converting DAO to ADO in my app. All of my DAO connections are of the following structure: Dim wsName As DAO.Workspace Dim dbName As DAO.Database Dim rsName As DAO.Recordset ...
4
by: Polar | last post by:
Hello everyone! I'm new here. I am doing a project, Digital Compass Navigation Aids. It consists of the 1490 Digital Compass, a P18F4620 Microcontroller, ISD2560 voice record/playback chip LM4808M...
6
by: Simon Harvey | last post by:
Hi all, I'm really hoping someone can help me with this as it's causing me some serious problems. I have a Windows Forms application using the gridview control. When the user selects a row,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...

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.