I taught myself VB... Just learning, the first program to get but.. with string

Private Sub Command15_Click()
Dim ph$
ph = photo.Value
Picture1.Picture = LoadPicture(App.Path & "\User\" & ph & ".jpg")
End Sub

I want to know what a Picture1.Picture is, then this one like the picture1 and picture is null
This is the Baidu, there are still problems.

Started by Ignativs at December 01, 2016 - 3:51 AM

The Picture property

Returns or to display settings in the control. For the OLE container control, are not available at design time at run time to read.


object.Picture [= picture]

The Picture property has the following components:

Part description
The object object expression, its value is "an object used in" list.
Picture string expression, specify a file containing the picture, "detailed settings".

Set the value

Picture settings are as follows:

Set the value description
(None) (the default) no pictures.
(Bitmap, icon, metafile, GIF, JPEG) Specify a picture. The design can load an image from the properties window. At run time, also can be in the bitmap, icon, or meta file using the LoadPicture function to set the attributes.


In the design, using the "Edit" menu in the "copy", "cutting" and "paste" command through the clipboard to transfer pictures, run time, can use the clipboard method, such as non text clipboard constants vbCFBitmap, vbCFMetafile and vbCFDIB of GetData, SetData and GetFormat, they are included in the object browser Visual Basic (VB) object library.

Set the Picture property at design time, the picture is stored and form at the same time loading. If you create an executable file, the file contains the image. If loaded at run time the picture, the picture with applications to save. Using the SavePicture statement from the form or picture frame picture is stored in the file.

Note that run time, the Picture property can be set to any other object DragIcon, Icon, Image or Picture attributes, or picture can be allocated LoadPicture returns to it.

Note that the Unisys Corporation has a patent, the patent claims related to some aspect of the GIF-LZW compression technology, the technology used in the PictureBox and Image controls. Microsoft Corporation of Unisys LZW licensed patent in 1996 September. However, Microsoft license does not extend to those software developers or third parties, they use any Microsoft toolkit, language development or the operating system to provide GIF read / write and / or any other LZW ability in their own products (for example, by DLL and API).

If your business applications using one of these controls (and thus the use of the LZW Technology), you may want to obtain independent legal advice on patents, detailed information please contact the Unisys USA.

Posted by Vern at December 04, 2016 - 4:37 AM

Picture1.Picture = LoadPicture(App.Path & "\User\" & ph & ".jpg")

This sentence, what prompted error?

Posted by Helena at December 10, 2016 - 5:26 AM