PRB: Problem Changing Control's Picture to (None) in VB 3.0

Last reviewed: September 15, 1995
Article ID: Q108602
The information in this article applies to:
  • Professional Edition of Microsoft Visual Basic for Windows, version 3.0

SYMPTOMS

You can attach a graphic to a form or picture control using the Picture property in Visual Basic. By default, Visual Basic gives a value of (none) for the Picture property in the Properties window. After you attach a graphic to a form or picture control, the Picture property has a value of (bitmap), (icon), or (metafile).

However, Visual Basic can prevent your attempts to detach the graphic. Highlighting the (bitmap), (icon), or (metafile) value and pressing DEL can fail to change the value to (none).

Please note that this reference to the DEL key refers to the DEL key on the numeric keypad, not the DELETE key on the main keyboard.

NOTE: The three dots on the right of the Settings box for the Picture property do not pop up a choice for (none). Visual Basic requires you to use the DEL key to change the Picture property value to (none).

CAUSE

Visual Basic requires you to click the Picture property in the Properties list immediately before highlighting the (bitmap), (icon), or (metafile) value for deletion. Visual Basic requires that click even if the Picture property has the focus from a previous operation.

WORKAROUND

To work around this behavior, click the Picture property in the Properties list before highlighting the (bitmap), (icon), or (metafile) value. Or, change the focus to any other property on the Properties window, then reselect the Picture property. The DEL key then correctly deletes the (bitmap), (icon), or (metafile) value and changes the value to (none). The graphic correctly disappears from the form or picture control.

STATUS

This behavior is under review and will be considered for correction in a future release.

MORE INFORMATION

Steps to Reproduce the Behavior

The following steps set the Picture property to (bitmap), (icon), or (metafile):

  1. Start a new project in Visual Basic. Form1 is created by default.

  2. Press the F4 key. Select the Picture property from the list in the Properties window.

  3. Click the three dots on the right of the Settings box. Visual Basic displays a dialog box from which you select a picture file. The graphic from the picture file displays on the form.

  4. Click the form to see the graphic. This changes the focus to the form.

  5. Press the F4 key to give focus back to the Properties window.

    NOTE: The Picture property is still highlighted on the list in the Properties window. To duplicate the behavior, don't click the Picture property until the workaround is explained further below.

  6. In the Settings box in the Properties window, highlight or double-click the word (bitmap), (icon), or (metafile). Press the DEL key. This fails to change the value to (none).

To work around this behavior, click the Picture property in the Properties list before highlighting the (bitmap), (icon), or (metafile) value. Or, change the focus to any other property on the Properties window, then reselect the Picture property. Then highlight the (bitmap), (icon), or (metafile) value. Press the DEL key to delete the value. This successfully changes the value to (none) and removes the graphic from the form.

REFERENCES

  • "Microsoft Visual Basic Version 3.0: Programmer's Guide", Page 324.


Additional reference words: 3.00 bitmap bitmaps .BMP .WMF .ICO .DIB
KBCategory: kbprg kbprb
KBSubcategory: PrgCtrlsStd


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: September 15, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.