Microsoft KB Archive/108602

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

Article ID: 108602

Article Last Modified on 1/8/2003

-

APPLIES TO


 * Microsoft Visual Basic 3.0 Professional Edition

-



This article was previously published under Q108602



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.



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.
 * 1) 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.

