How to Clear VB Picture Property at Run Time Using LoadPicture (80488)



The information in this article applies to:

  • Microsoft Visual Basic Standard Edition for Windows 2.0
  • Microsoft Visual Basic Standard Edition for Windows 3.0
  • Microsoft Visual Basic Professional Edition for Windows 2.0
  • Microsoft Visual Basic Professional Edition for Windows 3.0
  • Microsoft Visual Basic Standard Edition for Windows 1.0

This article was previously published under Q80488

SUMMARY

During execution of a Visual Basic program, you can clear the Picture property of a form or picture control by using the LoadPicture function. Calling LoadPicture with no parameters and assigning the result to the Picture property of a form or control will clear the Picture property.

MORE INFORMATION

This information is documented in the Visual Basic Help menu under the LoadPicture function.

Code Example

To clear the picture property at run time, do the following:

  1. Start Visual Basic.
  2. Make a picture box called Picture1.
  3. Assign a bitmap or icon the picture1.picture property.
  4. Add the following code to the form1.click event by double-clicking the form:
       Sub Form_Click ()
          picture1.picture = LoadPicture()
       End Sub
    						
  5. Run the program.
  6. Click the form.

Modification Type:MajorLast Reviewed:12/12/2003
Keywords:KB80488