Visual Basic Reference

Visual Studio 6.0

Picture Property

See Also    Example    Applies To

Returns or sets a graphic to be displayed in a control. For the OLE container control, not available at design time and read-only at run time.


object.Picture [= picture]

The Picture property syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
picture A string expression specifying a file containing a graphic, as described in Settings.


The settings for picture are:

Setting Description
(None) (Default) No picture.
(Bitmap, icon, metafile, GIF, JPEG) Specifies a graphic. You can load the graphic from the Properties window at design time. At run time, you can also set this property using the LoadPicture function on a bitmap, icon, or metafile.


At design time, you can transfer a graphic with the Clipboard using the Copy, Cut, and Paste commands on the Edit menu. At run time, you can use Clipboard methods such as GetData, SetData, and GetFormat with the nontext Clipboard constants vbCFBitmap, vbCFMetafile, and vbCFDIB, which are listed in the Visual Basic (VB) object library in the Object Browser.

When setting the Picture property at design time, the graphic is saved and loaded with the form. If you create an executable file, the file contains the image. When you load a graphic at run time, the graphic isn't saved with the application. Use the SavePicture statement to save a graphic from a form or picture box into a file.

Note   At run time, the Picture property can be set to any other object's DragIcon, Icon, Image, or Picture property, or you can assign it the graphic returned by the LoadPicture function.

Note   The Unisys Corporation has a patent that it alleges covers certain aspects of GIF-LZW compression technology, which the PictureBox and Image controls use. Microsoft Corporation obtained a license to the Unisys LZW patents in September, 1996. Microsoft's license does not, however, extend to software developers or third parties who use any Microsoft toolkit, language development, or operating system products to provide GIF read/write and/or any other LZW capabilities in their own products (for example, by way of DLLs and APIs).

If your commercial application uses either of these controls (and thus, the LZW technology), you may wish to obtain an independent legal opinion on the effect of the patent, or contact Unisys USA at for more information.