Export (0) Print
Expand All
Expand Minimize

OptionButton Control Changes in Visual Basic .NET

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

OptionButton Properties

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

1 - Right Justify

TextAlign
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
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.
ValueChecked
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.

OptionButton 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()

OptionButton Events

Visual Basic 6.0Visual Basic .NET Equivalent
ClickCheckedChanged
Note   In Visual Basic 6.0, the Click event was raised only when the state was changed to true; in Visual Basic .NET, it is raised for both true and false.
DblClickNo equivalent. Use the Click 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 RadioButton Control

Show:
© 2014 Microsoft