PictureBox Control

This control displays graphics on a form.

Library Name

PictureBoxCtl

DLL Name

Mscepicture.dll

The PictureBox control supports the following properties:

AutoSize FontName ScaleLeft
BackColor FontSize ScaleMode
BorderStyle FontStrikethru ScaleTop
DrawMode FontTransparent ScaleWidth
DrawStyle FontUnderline Tag
DrawWidth ForeColor Top
FillColor Height (ActiveX) Visible
FillStyle Left Width
FontBold Picture  
FontItalic ScaleHeight  

The PictureBox control supports the following methods:

Cls Refresh
DrawCircle ScaleX
DrawLine ScaleY
DrawPicture SetScale
DrawPoint TextHeight
DrawText TextWidth
Move  

The PictureBox control supports the following events:

Change KeyUp
Click MouseDown
DblClick MouseMove
KeyDown MouseUp
KeyPress Resize

Remarks

PictureBox controls and Image controls are very similar. Both can display .bmp and .2bp graphic files.

However, unlike the Image control, pictures loaded into a PictureBox control do not automatically resize to fit the picture. Instead, graphics maintain their original size, meaning that if the graphic is larger than the control, the system clips the image. Additionally, the PictureBox control cannot stretch the image to fit the size of the control, nor does it support scroll bars.

You can load pictures into the PictureBox control at design time by selecting the Picture property from the control's Properties window. PictureBox controls cannot act as containers.