Microsoft Knowledge Base
XL: Cannot Use Controls Placed Over Pictures
Last reviewed: July 12, 1996
Article ID: Q110625
The information in this article applies to:
- Microsoft Excel for Windows, versions 5.0, 5.0c
- Microsoft Excel for Windows 95, versions 7.0, 7.0a
- Microsoft Excel for the Macintosh, versions 5.0, 5.0a
SUMMARY
In a Microsoft Excel Dialog sheet, if you place a control other than a label, edit box, or scroll bar over a picture in a dialog box, the control will not function when the dialog box is run. For example, if you place an OK button on top of a picture in the dialog box, choosing the button will not dismiss the dialog box.
In order for the control to function properly, it must be moved so that it is not on top of a picture.
NOTE: This behavior is different from Microsoft Excel version 4.0.
MORE INFORMATION
In Microsoft Excel version 4.0, you can place a control over a picture and the control will function properly when the dialog box is run. However, this feature is not available with dialog boxes created in Microsoft Excel versions 5.0. and 7.0 In Microsoft Excel versions 5.0 and 7.0, the only controls that will function properly when placed on top of a picture are the label, edit box, and scroll bar controls.
WORKAROUNDS
To work around this problem, do either of the following:
- Place the controls and pictures on a worksheet instead of a dialog sheet. For more information on placing controls on a worksheet, see pages 223-231 in the Visual Basic User's Guide. -or-
If you place the picture on top of the control in the dialog sheet, the control may function as desired. However, controls that require redraw, such as option buttons, check boxes, and scrollable list boxes will still not function properly if a picture is placed on top of them. The following steps describe how to place the picture on top of the control (this method may or may not produce desired results):
1. Create the dialog box on the dialog sheet with all desired controls
and pictures in place. (The controls are on top of the pictures.)
2. Use the mouse to select the picture and the controls on top of the
picture.
3. Choose Placement and Group from the Format menu and choose Copy from
the Edit menu.
4. Choose Paste from the Edit menu. An "image" of the picture is pasted
on top of the dialog box.
5. Drag this image outside of the dialog box.
6. Select the picture in the dialog box and choose Placement and Ungroup
from the Format menu and then press the ESC key (or click outside the dialog box).
7. For each picture in the dialog box, select it and press the delete
key. This will delete all the pictures in the dialog box.
NOTE: The controls that were on top of the pictures should not be deleted.
8. Drag the copy of the image back on top of the dialog box. Make sure
to place the image in its original location so that it fits directly on top of the controls.
9. Run the Dialog box.
REFERENCES
"Visual Basic User's Guide," version 5.0, pages 223-231
KBCategory: kbusage Last reviewed: July 12, 1996 |