473,387 Members | 1,757 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.

VB2005 - Databound MaskedTextBox controls lose mask in MdiChild Forms.

I recently came across what I believe to be a peculiar bug with Mdi
Children, and wanted to see if anyone else had experienced this before
sending it in. The issue is as follows:

I have a number of forms set up as children of a single "Shell"
MdiParent. In these, I have a number of databound masked textbox
controls (for phone numbers, 9-digit zips, etc...). When I show the form
the first time, the masks show up fine; however, if I hide the form (not
close, just hide), then show it once more, the masks completely
disappear. The proper text is still displayed, simply sans mask. If you
attempt to edit the field, the mask will return, albeit in a peculiar
manner (hard to describe, seems to treat some of the data as literals
for the mask or something like that.)

If I close the form entirely and re-open it, I do not see this issue,
nor is it a problem if the form is not an MdiChild. Similarly, the
problem seems to be non-existent for unbound masked textboxes.

To be explicit, steps for recreation:
1. Create a new form; name this "ParentShell" or something of the sort,
and set its IsMdiContainer property to True.

2. Create a second new form; name this "ChildForm".

3. Add, to the ChildForm, a MaskedTextBox control bound to a phone
number field (just for example, anything works) in a database with some
data already entered. Set the control's mask to the default phone number
mask (or zip, or whatever you used).

4. In the ParentShell's Load event, set the ChildForm's parent to the
ParentShell, then show it, hide it, and show it once more:
ChildForm.MdiParent = Me
ChildForm.Show()
ChildForm.Hide()
ChildForm.Show()

(If you prefer, you may simply create a menu or a button on the parent
form that allows you to show and hide the child form at will; the issue
can be recreated without having the code all in one place.)

5.You should see the phone number (in the example) displayed as digits
without any remaining trace of the mask.

Any ideas/solutions?

Thanks,
Matt
Feb 22 '06 #1
1 1719
Hi Matt,

Based on my test, it seems that I can not reproduce the problem.
I bound to a SQL Server Northwind Customer Table of the Phone Field.

Can you provide a reproduce sample, so that we can reproduce at my side and
do further troubleshooting?
You can reach me via removing "online" from my Email address.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Feb 22 '06 #2

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

Similar topics

0
by: Chris | last post by:
Hi, Has anybody found any info on what characters signify what in the the .net 2.0 MaskedTextBox.Mask property. I want to create a custom mask and have no idea which characters mean what and...
2
by: SpotNet | last post by:
Hello NewsGroup, I have a MDIParent form with a docked left treeview control, a splitter control and a generic docked control on the right. Kind of looks like Windows Explorer, though it's...
2
by: JohnR | last post by:
Let's say I have an MDI parent form with a textbox. If I create an MDI child form and, at runtime, move the MDI child window over the textbox on the MDI parent, the textbox appears in front of the...
2
by: Jaime Rios | last post by:
Hi, I'm using C# to create a printable form. The data is coming from a XML source that I load when the application starts. I have no problems loading the data, but I am having a hard time figuring...
2
by: sklett | last post by:
Hi, I'm trying to define a mask for a MaskedTextBox and can't get it right. For 5 numbers, '00000' seems to be a valid mask and behaves correctly, but I know need a control that will take a...
1
by: Jeffrey Christiansen | last post by:
I wanted to add a toggle button to a VB2005 form to be used for a simple Windows Application (i.e. compiled to a "*.exe"), so I added the ActiveX Microsoft Forms Object toggle button, however I...
0
by: =?Utf-8?B?TWFyayBDb2xsYXJk?= | last post by:
I'm using the MaskedTextBox to make sure the user inserts a valid international phone number. I want to set the Mask property so that the user sees +49-__-____-____ in the text box. I set the...
1
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
We have some dumb and lazy people here, so I need help. To fix the dumb part: We have placed MaskedTextBoxes on the forms so they will stop entering the information incorrectly. Now the lazy...
1
by: eljainc | last post by:
Hello, I am trying to utilize a MaskedTextBox control on my form. I would like the user to enter numbers only (i.e. 65000), I set the Mask property as 999999 and the PromptChar as space (it...
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:
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.