MaskedEditBox won't display any text...

  • Thread starter Thread starter Dennis K.
  • Start date Start date
D

Dennis K.

I created a new VB.NET Windows Application and dragged a Microsoft
MaskedEditBox onto the empty form (did not change any of the defaults).
In Form1_Load I added the line...

AxMaskEdBox1.Text = "14"

But nothing is displayed in the box when I run the application.

Any idea what is going on here?
 
Dennis K. said:
I created a new VB.NET Windows Application and dragged a Microsoft
MaskedEditBox onto the empty form (did not change any of the defaults).
In Form1_Load I added the line...

AxMaskEdBox1.Text = "14"

But nothing is displayed in the box when I run the application.

Any idea what is going on here?

Are you referring to a MaskedEditBox (VB 6) or to a MaskedTextBox (.NET
Framework)?

I have no problem programmatically adding text to the Text property of a
MaskedTextBox using code similar to yours. (Using Visual Studio 2005).
 
Are you referring to a MaskedEditBox (VB 6) or to a MaskedTextBox (.NET
Framework)?

I have no problem programmatically adding text to the Text property of a
MaskedTextBox using code similar to yours. (Using Visual Studio 2005).

I am using Visual Studio .NET 2003 (Microsoft Development Environment
7.1.3088, Microsoft .NET Framework 1.1.4322). I added the Masked Edit
Control V6 (MSMASK32.OCX) from the "Tools|Add/Remove Toolbox Items"
menuitem. It was on the COM Components tab.
 
Dennis K. said:
I am using Visual Studio .NET 2003 (Microsoft Development Environment
7.1.3088, Microsoft .NET Framework 1.1.4322). I added the Masked Edit
Control V6 (MSMASK32.OCX) from the "Tools|Add/Remove Toolbox Items"
menuitem. It was on the COM Components tab.

OK, when I added a MaskedEditControl to a sample Windows app in VS 2005, I
did not find a Text property listed for the MaskedEditControl. When I used
the CtlText property, I was able to add text to the control with code, like
this:
AxMaskEdBox1.CtlText = "String in!"

As the intellisense list for the Masked Edit control does not include a Text
property, It's a mystery to me that your code compiles (but, it does).

Use the CtlText property.
 
OK, when I added a MaskedEditControl to a sample Windows app in VS 2005, I
did not find a Text property listed for the MaskedEditControl. When I used
the CtlText property, I was able to add text to the control with code

Ah ha. Thanks!

The Text property must be used for something else. In looking at the
Help for the control it says I should be using the SelText property.

Maybe next time I should RTFM. ;-)
 
Back
Top