How to Clear VB Picture Property at Run Time Using LoadPicture

Last reviewed: June 21, 1995
Article ID: Q80488
The information in this article applies to:

- Standard and Professional Editions of Microsoft Visual Basic for

  Windows, versions 2.0 and 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 reference words: 1.00 2.00 3.00
KBCategory: kbprg kbcode
KBSubcategory: PrgCtrlsStd APrgGrap


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 21, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.