How to Clear VB Picture Property at Run Time Using LoadPicture

ID: Q80488


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for Windows, versions 2.0, 3.0
  • Microsoft Visual Basic programming system for Windows, version 1.0


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.


Additional query words: 2.00 3.00

Keywords :
Version :
Platform :
Issue type :


Last Reviewed: September 16, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.