Pasting Control to VB Form Does Not Dirty the Form

ID Number: Q76982

1.00

WINDOWS

buglist1.00

Summary:

A form is said to be "dirty" if that form has been changed in any way;

whether by changing its properties, by adding controls to the form, or

by changing the properties of the controls on the form. However,

pasting a control onto a form doesn't cause that form to become dirty.

If the program is run, the control disappears, or if the project is

saved, the user is not prompted to save the form. Therefore, if you

create a form that only has controls that have been pasted from

another form, you will need to save the form before running the

program, exiting Visual Basic, or choosing a new project.

Microsoft has confirmed this to be a problem in Microsoft Visual Basic

programming system version 1.0 for Windows. We are researching this

problem and will post new information here as it becomes available.

More Information:

Steps to Reproduce Problem

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

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

N). Form1 will be created by default.

2. From the File menu, choose Save File (ALT, F, S) to save Form1.

Choose the OK button to save the file as FORM1.FRM.

3. From the File menu, choose New Form (ALT, F, F). Form2 will be

created by default.

4. Place a command button (Command1) on Form2.

5. Copy Command1 from Form2 by choosing Copy from the Edit menu.

6. Click on Form1 to activate it and paste Command1 onto Form1 by

choosing Paste from the Edit menu.

Command1 will be pasted onto Form1 but the form is not dirty. Try the

following procedure:

1. Press F5 to run the program. The command button on Form1 will be

gone at run mode and even after returning to the design mode.

Moreover, Command1 exists in the object list of the form and if

another command button is created on Form1, its caption will be

Command2. If there is code associated with the pasted control, the

program will generate an "Unrecoverable Application Error" (UAE) when

it is run.

2. Exit Visual Basic (ALT, F, X) or choose New Project from the File

menu. You will be prompted to save the changes to Form2, but not to

Form1.

To work around this problem, you must save the form by selecting Save

File from the File menu (ALT, F, S) yourself before switching to run

mode, exiting Visual Basic, or choosing a new project.

Additional reference words: 1.00