This documentation is archived and is not being maintained.

CheckBox Control Changes in Visual Basic .NET

The CheckBox control in Visual Basic 6.0 is replaced by the Windows Forms CheckBox 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.

CheckBox Properties

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

1 - Right Justify

CheckAlign
System.Drawing.ContentAlignment.MiddleLeft

System.Drawing.ContentAlignment.MiddleRight

Appearance
0 – Flat

1 - 3D

FlatStyle
FlatStyle.Flat

FlatStyle.Standard

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.
CaptionText
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.
DisabledPictureNo equivalent. For more information, see Style Property Changes in Visual Basic .NET.
DownPictureNo equivalent. For more information, see Style Property 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.
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.
MaskColorNo equivalent. For more information, see MaskColor Changes in Visual Basic .NET.
MouseIconNo equivalent. For more information, see Cannot set a custom MousePointer.
MousePointerCursor

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

NameName
OLEDropModeNo equivalent. For more information, see Drag and Drop Changes in Visual Basic .NET.
ParentFindForm method
PictureImage
RightToLeft
True

False

RightToLeft
RightToLeft.Yes

RightToLeft.No

Style
0 – Standard

1 - Graphical

Appearance
Note   There are differences in how the Graphical style is handled in Visual Basic .NET. For more information, see Style Property Changes in Visual Basic .NET.
Appearance.Normal

Appearance.Button

TabIndexTabIndex
TabStopTabStop
TagTag
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.
UseMaskColorNo equivalent. For more information, see MaskColor Changes in Visual Basic .NET.
Value
0 – vbUnchecked

1 – vbChecked

2 - vbGrayed

CheckState
CheckState.Unchecked

CheckState.Checked

CheckState.Indeterminate

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.

CheckBox Methods

Visual Basic 6.0Visual Basic .NET Equivalent
DragNo equivalent. For more information, see Drag and Drop 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()

CheckBox Events

Visual Basic 6.0Visual Basic .NET Equivalent
ClickCheckStateChanged
Note   In Visual Basic 6.0, the Click event was raised when the CheckBox state was changed programmatically. In Visual Studio .NET, the Click event is not raised; therefore, you should use the CheckStateChanged event.
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
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 CheckBox Control

Show: