Export (0) Print
Expand All
Expand Minimize

TextBox Control Changes in Visual Basic .NET

The TextBox control in Visual Basic 6.0 is replaced by the Windows Forms TextBox control in Visual Basic .NET. The names of some properties, methods, events, and constants are different, and in some cases there are differences in behavior.

The following tables list Visual Basic 6.0 properties, methods, and events and their Visual Basic .NET equivalents. Where applicable, constants are indented beneath the property or method. All Visual Basic .NET constants map to the System.Windows.Forms namespace unless otherwise noted.

Links are provided as necessary to topics explaining differences in behavior. Where there is no direct equivalent in Visual Basic .NET, links are provided to topics that present alternatives.

TextBox Properties

Visual Basic 6.0Visual Basic .NET Equivalent
Alignment
0 - Left Justify

1 - Right Justify

2 - Center

TextAlign
HorizontalAlignment.Left

HorizontalAlignment.Right

HorizontalAlignment.Center

AppearanceNo equivalent. For more information, see Appearance and BorderStyle Property Changes in Visual Basic .NET.
BackColor
BackColor
Note   Colors are handled differently in Visual Basic .NET. For more information, see Color Behavior Changes in Visual Basic .NET.
For a list of constants, see Color Changes in Visual Basic .NET.
BorderStyle
0 – None

1 – Fixed Single

BorderStyle
BorderStyle.None

BorderStyle.FixedSingle

CausesValidationCausesValidation
ContainerParent
DataChangedNo equivalent. For more information, see Data Changes in Visual Basic .NET.
DataFieldNo equivalent. For more information, see Data Changes in Visual Basic .NET.
DataFormatNo equivalent. For more information, see Data Changes in Visual Basic .NET.
DataMemberNo equivalent. For more information, see Data Changes in Visual Basic .NET.
DataSourceNo equivalent. For more information, see Data Changes in Visual Basic .NET.
DragIconNo equivalent. For more information, see Drag and Drop Changes in Visual Basic .NET.
DragModeNo equivalent. For more information, see Drag and Drop Changes in Visual Basic .NET.
EnabledEnabled
FontFont
Note   Fonts are handled differently in Visual Basic .NET. For more information, see Font Changes in Visual Basic .NET.
FontBoldFont
Note   Fonts are handled differently in Visual Basic .NET. For more information, see Font Changes in Visual Basic .NET.
FontItalicFont
Note   Fonts are handled differently in Visual Basic .NET. For more information, see Font Changes in Visual Basic .NET.
FontNameFont
Note   Fonts are handled differently in Visual Basic .NET. For more information, see Font Changes in Visual Basic .NET.
FontSizeFont
Note   Fonts are handled differently in Visual Basic .NET. For more information, see Font Changes in Visual Basic .NET.
FontStrikethruFont
Note   Fonts are handled differently in Visual Basic .NET. For more information, see Font Changes in Visual Basic .NET.
FontUnderlineFont
Note   Fonts are handled differently in Visual Basic .NET. For more information, see Font Changes in Visual Basic .NET.
ForeColor
ForeColor
Note   Colors are handled differently in Visual Basic .NET. For more information, see Color Behavior Changes in Visual Basic .NET.
For a list of constants, see Color Changes in Visual Basic .NET.
HeightHeight, Size
Note   Coordinates are handled differently in Visual Basic .NET. For more information, see Coordinate System Changes in Visual Basic .NET.
HelpContextIDNo equivalent. For more information, see Help Support Changes in Visual Basic .NET.
HideSelectionHideSelection
HWndHandle
IndexNo equivalent. For more information, see Control Array Changes in Visual Basic .NET.
LeftLeft
Note   Coordinates are handled differently in Visual Basic .NET. For more information, see Coordinate System Changes in Visual Basic .NET.
LinkItemNo equivalent. For more information, see Dynamic Data Exchange Changes in Visual Basic .NET.
LinkModeNo equivalent. For more information, see Dynamic Data Exchange Changes in Visual Basic .NET.
LinkTimeOutNo equivalent. For more information, see Dynamic Data Exchange Changes in Visual Basic .NET.
LinkTopicNo equivalent. For more information, see Dynamic Data Exchange Changes in Visual Basic .NET.
LockedReadOnly
MaxLengthMaxLength
Note   In Visual Basic 6.0 it was not possible to programmatically set the Text property to a length greater than the MaxLength value; in Visual Basic .NET this is now possible.
MouseIconNo equivalent. For more information, see Cannot set a custom MousePointer.
MousePointerCursor

For a list of constants, see MousePointer Changes in Visual Basic .NET.

MultiLineMultiLine
NameName
OLEDragModeNo equivalent. For more information, see Drag and Drop Changes in Visual Basic .NET.
OLEDropModeNo equivalent. For more information, see Drag and Drop Changes in Visual Basic .NET.
ParentFindForm method
PasswordCharPasswordChar
Note   In Visual Basic 6.0 the PasswordChar property was of type String; in Visual Basic .NET it is of type Char.
RightToLeft
True

False

RightToLeft
RightToLeft.Yes

RightToLeft.No

ScrollBars
0 – None

1 – Horizontal

2 – Vertical

3 – Both

ScrollBars
ScrollBars.None

ScrollBars.Horizontal

ScrollBars.Vertical

ScrollBars.Both

SelLengthSelectionLength
SelStartSelectionStart
SelTextSelectedText
TabIndexTabIndex
TabStopTabStop
TagTag
TextText
ToolTipTextToolTip component

For more information, see ToolTip Changes in Visual Basic .NET.

TopTop
Note   Coordinates are handled differently in Visual Basic .NET. For more information, see Coordinate System Changes in Visual Basic .NET.
VisibleVisible
WhatsThisHelpIDNo equivalent. For more information, see Help Support Changes in Visual Basic .NET.
WidthWidth, Size
Note   Coordinates are handled differently in Visual Basic .NET. For more information, see Coordinate System Changes in Visual Basic .NET.

TextBox Methods

Visual Basic 6.0Visual Basic .NET Equivalent
DragNo equivalent. For more information, see Drag and Drop Changes in Visual Basic .NET.
LinkExecuteNo equivalent. For more information, see Dynamic Data Exchange Changes in Visual Basic .NET.
LinkPokeNo equivalent. For more information, see Dynamic Data Exchange Changes in Visual Basic .NET.
LinkRequestNo equivalent. For more information, see Dynamic Data Exchange Changes in Visual Basic .NET.
LinkSendNo equivalent. For more information, see Dynamic Data Exchange Changes in Visual Basic .NET.
MoveSetBounds
Note   Coordinates are handled differently in Visual Basic .NET. For more information, see Coordinate System Changes in Visual Basic .NET.
OLEDragNo equivalent. For more information, see Drag and Drop Changes in Visual Basic .NET.
RefreshRefresh
SetFocusFocus
ShowWhatsThisNo equivalent. For more information, see Help Support Changes in Visual Basic .NET.
ZOrder
0 – vbBringToFront

1 - vbSendToBack

BringToFront() or SendToBack() functions
BringToFront()

SendToBack()

TextBox Events

Visual Basic 6.0Visual Basic .NET Equivalent
ChangeTextChanged
ClickNo equivalent. Use MouseUp as an alternative.
DblClickDoubleClick
DragDropNo equivalent. For more information, see Drag and Drop Changes in Visual Basic .NET.
DragOverNo equivalent. For more information, see Drag and Drop Changes in Visual Basic .NET.
GotFocusEnter
KeyDownKeyDown
KeyPressKeyPress
KeyUpKeyUp
LinkCloseNo equivalent. For more information, see Dynamic Data Exchange Changes in Visual Basic .NET.
LinkErrorNo equivalent. For more information, see Dynamic Data Exchange Changes in Visual Basic .NET.
LinkNotifyNo equivalent. For more information, see Dynamic Data Exchange Changes in Visual Basic .NET.
LinkOpenNo equivalent. For more information, see Dynamic Data Exchange Changes in Visual Basic .NET.
LostFocusLeave
MouseDownMouseDown
MouseMoveMouseMove
MouseUpMouseUp
OLECompleteDragNo equivalent. For more information, see Drag and Drop Changes in Visual Basic .NET.
OLEDragDropNo equivalent. For more information, see Drag and Drop Changes in Visual Basic .NET.
OLEDragOverNo equivalent. For more information, see Drag and Drop Changes in Visual Basic .NET.
OLEGiveFeedbackNo equivalent. For more information, see Drag and Drop Changes in Visual Basic .NET.
OLESetDataNo equivalent. For more information, see Drag and Drop Changes in Visual Basic .NET.
OLEStartDragNo equivalent. For more information, see Drag and Drop Changes in Visual Basic .NET.
ValidateValidating

See Also

Introduction to the Windows Forms TextBox Control

Show:
© 2015 Microsoft