MaskEdBox Control for Visual Basic 6.0 Users
The MaskEdBox control in Visual Basic 6.0 is replaced by the Windows Forms MaskedTextBox control in Visual Basic 2008. The names of some properties, methods, events, and constants are different, and in some cases there are differences in behavior.
Conceptual Differences
In Visual Basic 6.0, the AutoTab property determines whether the next control in the TAB order receives focus as soon as the Text property of a MaskEdBox control is filled with valid data.
In Visual Basic 2008, there is no equivalent for the AutoTab property. You can achieve the same effect by monitoring and validating the input, and setting the focus to the next control yourself.
In Visual Basic 6.0, the PasswordChar property is of type String; in Visual Basic 2008 it is of type Char.
In addition, there are numerous conceptual differences that apply to all controls, including differences in data binding, font handling, drag-and-drop, Help support and more. For more information, see Windows Forms Concepts for Visual Basic 6.0 Users.
MaskedEdBox Control Property, Method, and Event Equivalencies
The following tables list Visual Basic 6.0 properties, methods, and events, along with their Visual Basic 2008 equivalents. Those properties, methods, and events that have the same name and behavior are not listed. All Visual Basic 2008 enumerations map to the System.Windows.Forms namespace unless otherwise noted.
This table provides links to topics explaining behavior differences. Where there is no direct equivalent in Visual Basic 2008, links are provided to topics that present alternatives.
Properties
Visual Basic 6.0 |
Visual Basic 2008 Equivalent |
---|---|
AllowPrompt |
|
Appearance |
New implementation. For more information, see Appearance and BorderStyle Properties for Visual Basic 6.0 Users. |
AutoTab |
New implementation. |
BackColor |
Note:
Colors are handled differently in Visual Basic 2008. For more information, see Color Handling for Visual Basic 6.0 Users.
|
ClipMode |
|
ClipText |
Note:
The Visual Basic 6.0 ClipText property excludes literals; in Visual Basic 2008 literals are included unless SkipLiterals is set to true.
|
Container |
|
DataBinding DataChanged DataField DataFormat |
New implementation. For more information, see Data Access for Visual Basic 6.0 Users. |
DragIcon DragMode |
New implementation. For more information, see Drag and Drop for Visual Basic 6.0 Users. |
Font FontBold FontItalic FontName FontSize FontStrikethrough FontUnderline |
Note:
Fonts are handled differently in Visual Basic 2008. For more information, see Font Object for Visual Basic 6.0 Users.
|
ForeColor |
Note:
Colors are handled differently in Visual Basic 2008. For more information, see Color Handling for Visual Basic 6.0 Users.
|
Format |
New implementation. Use formatting functions such as FormatNumber Function (Visual Basic) or FormatDateTime Function (Visual Basic). |
FormattedText |
Note:
The Visual Basic 6.0 ClipText property excludes literals; in Visual Basic 2008 literals are included unless SkipLiterals is set to true.
|
Height |
Note:
Coordinates are handled differently in Visual Basic 2008. For more information, see Coordinate System for Visual Basic 6.0 Users.
|
HelpContextID |
New implementation. For more information, see Help Support for Visual Basic 6.0 Users. |
HWnd |
|
Index |
New implementation. For more information, see Control Arrays for Visual Basic 6.0 Users. |
Left |
Note:
Coordinates are handled differently in Visual Basic 2008. For more information, see Coordinate System for Visual Basic 6.0 Users.
|
MouseIcon |
New implementation. For more information, see Cannot set a custom MousePointer. |
MousePointer |
For a list of constants, see MousePointer for Visual Basic 6.0 Users. |
OLEDragMode OLEDropMode |
New implementation. For more information, see Drag and Drop for Visual Basic 6.0 Users. |
Parent |
FindForm method |
PromptInclude |
|
SelLength |
|
SelStart |
|
SelText |
|
ToolTipText |
ToolTip component. For more information, see ToolTip Support for Visual Basic 6.0 Users. |
Top |
Note:
Coordinates are handled differently in Visual Basic 2008. For more information, see Coordinate System for Visual Basic 6.0 Users.
|
WhatsThisHelpID |
New implementation. For more information, see Help Support for Visual Basic 6.0 Users. |
Width |
Note:
Coordinates are handled differently in Visual Basic 2008. For more information, see Coordinate System for Visual Basic 6.0 Users.
|
Methods
Visual Basic 6.0 |
Visual Basic 2008 Equivalent |
---|---|
Drag |
New implementation. For more information, see Drag and Drop for Visual Basic 6.0 Users. |
Move |
Note:
Coordinates are handled differently in Visual Basic 2008. For more information, see Color Handling for Visual Basic 6.0 Users.
|
OLEDrag |
New implementation. For more information, see Drag and Drop for Visual Basic 6.0 Users. |
SetFocus |
|
ShowWhatsThis |
New implementation. For more information, see Help Support for Visual Basic 6.0 Users. |
ZOrder |
BringToFront or SendToBack function |
Events
Visual Basic 6.0 |
Visual Basic 2008 Equivalent |
---|---|
Change |
|
DblClick |
|
DragDrop DragOver |
New implementation. For more information, see Drag and Drop for Visual Basic 6.0 Users. |
GotFocus |
|
LostFocus |
|
OLECompleteDrag OLEDragDrop OLEDragOver OLEGiveFeedback OLESetData OLEStartDrag |
New implementation. For more information, see Drag and Drop for Visual Basic 6.0 Users. |
Validate |
|
ValidationError |
Upgrade Notes
When a Visual Basic 6.0 application is upgraded to Visual Basic 2008, any MaskEdBox controls are upgraded to Windows Forms MaskedTextBox controls, and properties, methods and events are upgraded to their equivalents. Where there may be differences in behavior, upgrade comments are inserted into the code.
See Also
Tasks
Walkthrough: Working with the MaskedTextBox Control
How to: Bind Data to the MaskedTextBox Control