Discussion:
VB6: Text in Masked Edit Control temporarily disappeared when the control lost the focus
(too old to reply)
roger
2007-07-06 03:54:16 UTC
Permalink
Hi,

I need some help. I am using Masked Edit Control and trying to set up a
format (to accept only numeric entry). I am using VB6

When I enter all numbers in the Masked Edit Control box, and move the focus
to another control,
the numbers in the Masked Edit Control that I typed temporarily dissappears
and the only format of the
Masked Edit Control shows. However, when I move my focus back to the
control, everything (numbers) is there.

Here I can reproduce my problem.
1) place a command control button on a form
2) place a Masked Edit Control on a form
3) place the following codes in the form under one of the command control
subroutines


Private Sub Command1_Click()

MaskEdBox1.Mask = "##-###"
MaskEdBox1.Format = "__-___"


End Sub

If you enter all numbers in the Masked Edit Control box, and move your
focus to another control,
the text in the control will show "__-___", not the numbers just entered.


Also, if I doubled click the button only one time,
the " - " text (an empty format shows) will show in the Masked Edit
Control box.
However, the real format (when the focus is moved to the control) is still
"__-___"

If I doubled click the button twice, the "__-___" text will show in the
Masked Edit Control box instead.



Thank you for any help and suggestions.

R
roger
2007-07-06 04:07:03 UTC
Permalink
Wop!

It seems that this newsgroup is dead.
Post by roger
Hi,
I need some help. I am using Masked Edit Control and trying to set up a
format (to accept only numeric entry). I am using VB6
When I enter all numbers in the Masked Edit Control box, and move the
focus to another control,
the numbers in the Masked Edit Control that I typed temporarily
dissappears and the only format of the
Masked Edit Control shows. However, when I move my focus back to the
control, everything (numbers) is there.
Here I can reproduce my problem.
1) place a command control button on a form
2) place a Masked Edit Control on a form
3) place the following codes in the form under one of the command control
subroutines
Private Sub Command1_Click()
MaskEdBox1.Mask = "##-###"
MaskEdBox1.Format = "__-___"
End Sub
If you enter all numbers in the Masked Edit Control box, and move your
focus to another control,
the text in the control will show "__-___", not the numbers just entered.
Also, if I doubled click the button only one time,
the " - " text (an empty format shows) will show in the Masked Edit
Control box.
However, the real format (when the focus is moved to the control) is still
"__-___"
If I doubled click the button twice, the "__-___" text will show in the
Masked Edit Control box instead.
Thank you for any help and suggestions.
R
Robert Morley
2007-07-06 04:50:34 UTC
Permalink
There aren't a lot of bugs in VB6 that haven't been discussed before, so
this group doesn't tend to get a lot of action, but there's a fair number of
knowledgeable people in here. So don't worry, someone will undoubtedly
respond to your post (besides me, that is).



Rob
Post by roger
Wop!
It seems that this newsgroup is dead.
Post by roger
Hi,
I need some help. I am using Masked Edit Control and trying to set up a
format (to accept only numeric entry). I am using VB6
When I enter all numbers in the Masked Edit Control box, and move the
focus to another control,
the numbers in the Masked Edit Control that I typed temporarily
dissappears and the only format of the
Masked Edit Control shows. However, when I move my focus back to the
control, everything (numbers) is there.
Here I can reproduce my problem.
1) place a command control button on a form
2) place a Masked Edit Control on a form
3) place the following codes in the form under one of the command
control subroutines
Private Sub Command1_Click()
MaskEdBox1.Mask = "##-###"
MaskEdBox1.Format = "__-___"
End Sub
If you enter all numbers in the Masked Edit Control box, and move your
focus to another control,
the text in the control will show "__-___", not the numbers just entered.
Also, if I doubled click the button only one time,
the " - " text (an empty format shows) will show in the Masked Edit
Control box.
However, the real format (when the focus is moved to the control) is
still "__-___"
If I doubled click the button twice, the "__-___" text will show in the
Masked Edit Control box instead.
Thank you for any help and suggestions.
R
RomoR
2007-07-08 11:19:42 UTC
Permalink
Do you wanna solution or you are saying that its a bug. I cant comment on
bugs.

If you wanna solution you can format the masked edit control in design time
or you can format it in Form_Load event which will solve the problem.

RomoR
Post by roger
Hi,
I need some help. I am using Masked Edit Control and trying to set up a
format (to accept only numeric entry). I am using VB6
When I enter all numbers in the Masked Edit Control box, and move the
focus to another control,
the numbers in the Masked Edit Control that I typed temporarily
dissappears and the only format of the
Masked Edit Control shows. However, when I move my focus back to the
control, everything (numbers) is there.
Here I can reproduce my problem.
1) place a command control button on a form
2) place a Masked Edit Control on a form
3) place the following codes in the form under one of the command control
subroutines
Private Sub Command1_Click()
MaskEdBox1.Mask = "##-###"
MaskEdBox1.Format = "__-___"
End Sub
If you enter all numbers in the Masked Edit Control box, and move your
focus to another control,
the text in the control will show "__-___", not the numbers just entered.
Also, if I doubled click the button only one time,
the " - " text (an empty format shows) will show in the Masked Edit
Control box.
However, the real format (when the focus is moved to the control) is still
"__-___"
If I doubled click the button twice, the "__-___" text will show in the
Masked Edit Control box instead.
Thank you for any help and suggestions.
R
Loading...