Export (0) Print
Expand All
Expand Minimize

PictureBox Control Changes in Visual Basic .NET

The PictureBox control in Visual Basic 6.0 is replaced by the Windows Forms PictureBox 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 Visual Basic 6.0 PictureBox control was a container control; the Visual Basic .NET PictureBox control is not. During upgrade, PictureBox controls that contain controls are upgraded to Panel controls.

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.

PictureBox Properties

Visual Basic 6.0Visual Basic .NET Equivalent
Align
0 – None

1 – Top

2 – Bottom

3 – Left

4 – Right

Dock
DockStyle.None

DockStyle.Top

DockStyle.Bottom

DockStyle.Left

DockStyle.Right

AppearanceNo equivalent. For more information, see Appearance and BorderStyle Property Changes in Visual Basic .NET.
AutoRedrawNo equivalent. For more information, see Graphics Changes in Visual Basic .NET.
AutoSize
False

True

PictureBoxSizeMode
Note   For PictureBox controls that are upgraded to Panel controls, there is no equivalent for AutoSize.
PictureBoxSizeMode.Normal

PictureBoxSizeMode.AutoSize

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
Note   In Visual Basic 6.0, the default was 1 – Fixed Single, in Visual Basic .NET the default is None.
BorderStyle.None

BorderStyle.FixedSingle

CausesValidationCausesValidation
ClipControlsNo equivalent. For more information, see Graphics Changes in Visual Basic .NET.
ContainerParent
CurrentXNo equivalent. For more information, see Graphics Changes in Visual Basic .NET.
CurrentYNo equivalent. For more information, see Graphics Changes in Visual Basic .NET.
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.
DrawModeNo equivalent. For more information, see Graphics Changes in Visual Basic .NET.
DrawStyleNo equivalent. For more information, see Graphics Changes in Visual Basic .NET.
DrawWidthNo equivalent. For more information, see Graphics Changes in Visual Basic .NET.
EnabledEnabled
FillColorNo equivalent. For more information, see Graphics Changes in Visual Basic .NET.
FillStyleNo equivalent. For more information, see Graphics Changes in Visual Basic .NET.
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.
FontTransparentNo equivalent. For more information, see Graphics 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.
HasDCNo equivalent. For more information, see Graphics Changes in Visual Basic .NET.
HDCNo equivalent. For more information, see Graphics 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
ImageNo equivalent. For more information, see Graphics Changes in Visual Basic .NET.
Note   In Visual Basic .NET, the Image property is the equivalent of the Visual Basic 6.0 Picture property.
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.
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
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
PictureImage
Note   For Visual Basic 6.0 PictureBox controls that were upgraded to Panel controls, the Picture property is mapped to the BackgroundPicture property.
RightToLeft
True

False

RightToLeft
RightToLeft.Yes

RightToLeft.No

ScaleHeightNo equivalent. For more information, see Coordinate System Changes in Visual Basic .NET.
ScaleLeftNo equivalent. For more information, see Coordinate System Changes in Visual Basic .NET.
ScaleModeNo equivalent. For more information, see Coordinate System Changes in Visual Basic .NET.
ScaleTopNo equivalent. For more information, see Coordinate System Changes in Visual Basic .NET.
ScaleWidthNo equivalent. For more information, see Coordinate System Changes in Visual Basic .NET.
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.
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.

PictureBox Methods

Visual Basic 6.0Visual Basic .NET Equivalent
CircleNo equivalent. For more information, see Graphics Changes in Visual Basic .NET.
ClsNo equivalent. For more information, see Graphics Changes in Visual Basic .NET.
DragNo equivalent. For more information, see Drag and Drop Changes in Visual Basic .NET.
LineNo equivalent. For more information, see Graphics 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.
PaintPictureNo equivalent. For more information, see Graphics Changes in Visual Basic .NET.
PointNo equivalent. For more information, see Graphics Changes in Visual Basic .NET.
PrintNo equivalent. For more information, see Graphics Changes in Visual Basic .NET.
PsetNo equivalent. For more information, see Graphics Changes in Visual Basic .NET
RefreshRefresh
ScaleNo equivalent. For more information, see Coordinate System Changes in Visual Basic .NET.
ScaleXNo equivalent. For more information, see Coordinate System Changes in Visual Basic .NET.
ScaleYNo equivalent. For more information, see Coordinate System Changes in Visual Basic .NET.
SetFocusActivate
ShowWhatsThisNo equivalent. For more information, see Help Support Changes in Visual Basic .NET.
TextHeightNo equivalent. For more information, see Graphics Changes in Visual Basic .NET.
TextWidthNo equivalent. For more information, see Graphics Changes in Visual Basic .NET.
ZOrder
0 – vbBringToFront

1 - vbSendToBack

BringToFront() or SendToBack() functions
BringToFront()

SendToBack()

PictureBox Events

Visual Basic 6.0Visual Basic .NET Equivalent
ChangeNo equivalent. There are individual events (BackgroundImageChanged, SizeChanged, and so forth) that are raised when some properties are changed.
ClickClick
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
KeyDownNo equivalent. The Visual Basic .NET PictureBox control is not a container control and does not receive keystrokes.
KeyPressNo equivalent. The Visual Basic .NET PictureBox control is not a container control and does not receive keystrokes.
KeyUpNo equivalent. The Visual Basic .NET PictureBox control is not a container control and does not receive keystrokes.
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.
PaintPaint
ResizeResize
ValidateValidating

See Also

Introduction to the Windows Forms PictureBox Control

Show:
© 2015 Microsoft