VB Common Dialog Repositions When Pasting to Other Control

ID Number: Q82000

1.00

WINDOWS

Summary:

Normally when you design an application in the Visual Basic

environment, cutting a control will reset the Top and Left property

values for that control to zero. Therefore, when you paste the control

into a new container, it will be positioned in the upper left corner

of that container. However, when you apply this to the Common Dialog

custom control, the Top and Left property values are not reset to

zero, and remain at the current offset of the container you cut the

control from. This isn't a problem except that the new container may

be smaller than the original container, and the control may be placed

at a position that is not currently in view, which may cause confusion

for the programmer.

Microsoft has confirmed this to be a problem with the Common Dialog

custom control supplied with Microsoft Professional Toolkit for

Microsoft Visual Basic programming system version 1.0 for Windows.

More Information:

Steps to Reproduce Problem

--------------------------

1. Run Visual Basic, or from the File menu, choose New Project (ALT,

F, N) if Visual Basic is already running. Form1 is created by

default.

2. From the File menu, choose Add File. In the Files box, select the

CMDIALOG.VBX custom control file. The Common Dialog tool appears in

the Toolbox.

3. Set the Height and Width properties of the form to 5000 and 5500,

respectively.

4. Double-click the Common Dialog icon in the Toolbox, and move the

control to the lower right corner of the form.

5. While the Common Dialog control is still in focus, choose Cut from

the Visual Basic Edit menu.

6. Change the Width property of the form to 2000.

7. From the Edit menu, choose Paste.

Notice that the Common Dialog control is not visible although it has

been pasted to your form. To verify that it was pasted, change the

Width property of the form to 5500. To verify that this problem only

occurs with the Common Dialog custom control, Repeat the previous

steps with any of the other Visual Basic built-in controls to verify

that this only occurs with the Common Dialog custom control.

Additional reference words: 1.00