Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / August 2006

Tip: Looking for answers? Try searching our database.

MaskedTextBox.Modified not worknig

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Locker - 30 Aug 2006 00:17 GMT
I am using Visual Studio 2005 to develop a Windows Application using Visual
Basic. I have added a MaskedTextBox to one of my forms and am trying to check
it for changes.

There is a property called MaskedTextBox.Modified that is suppose to return
'True' if the controls contents have been modified. Property doesn't seem to
be working because no matter how much data I type (not programmically set)
into the maskedtextbox it always returns 'False'.

I found a single reference to this problem using a google search and the guy
basically said the 'Modified' property only works if you do not set the
'Mask' property of the MaskedTextBox, which seems like a bug since you
wouldn't use a maskedtextbox if you didn't want to use a mask.

I would love some insight or feedback if possible and I've included the link
to the msdn description of this property below:

http://msdn2.microsoft.com/en-us/library/system.windows.forms.textboxbase.modifi
ed.aspx

Locker - 30 Aug 2006 16:25 GMT
As a work around I am setting this property manually using the
maskedtextbox.textchanged event. The following is an example:

Private Sub SetMaskedTextBox_Modified(ByVal sender As System.Object, _
       ByVal e As System.EventArgs) Handles mskMyField.TextChanged
       mskMyField.Modified = True
End Sub

It may be necessary to set the property to false in your MyBase.Load event
handler procedure if you are setting a default value for the MaskedTextBox. I
set a default value for phone number and then set the mskMyField.Modified
property to false as follows:

Private Sub OnFormLoad(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
       mskMyField.Text = "916"
       mskMyField.Modified = False
End Sub

> I am using Visual Studio 2005 to develop a Windows Application using Visual
> Basic. I have added a MaskedTextBox to one of my forms and am trying to check
[quoted text clipped - 14 lines]
>
> http://msdn2.microsoft.com/en-us/library/system.windows.forms.textboxbase.modifi
ed.aspx

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.