In VB Break, MDIChild with List Box Can Lose Code Window Focus

ID Number: Q83804

1.00

WINDOWS

buglist1.00

Summary:

If a standard Visual Basic list box is a child control of the MDI

Child custom control, then in break mode in the VB.EXE environment,

pressing the F5 key will not keep the focus in the Code window if you

encounter another break point, but will instead cycle through the Code

window and the list box on your MDI Child control on subsequent break

points.

Microsoft has confirmed this problem in Microsoft Professional Toolkit

for 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) 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

MDICHILD.VBX custom control file. The MDI Child tool appears in

the Toolbox.

3. Place an MDI Child control (MDIChild1) on Form1.

4. Create a list box on the MDI Child control. Please note that you

must place the list box on the MDI Child control as a child

control, not as an overlapping control. To do this correctly, do

the following:

a. Set focus on the MDIChild1 control by clicking the control with

the mouse.

b. Click once on the List Box tool in the Toolbox.

c. Move the cursor of MDIChild1 and click and drag the mouse. You

should notice List1 on top of the MDIChild1 control. Moving the

MDIChild1 control should also move the List1 control.

5. Add the following code to your Form_Click event:

Sub Form_Click ()

Debug.Print "Break point one"

Debug.Print "Break point two"

Debug.Print "Break point three"

Debug.Print "Break point four"

Debug.Print "Break point five"

Debug.Print "Break point six"

End Sub

6. Move the cursor to each Debug.Print statement and press F9. The

line of code should become bold if the break point is set

correctly.

7. Press F5 to run the program.

8. Click on the form with the mouse.

The program should break on the first Debug.Print statement and

display the Code window.

9. Press F5. The program will break on the next line, but focus is

incorrectly set back to the form. Correct behavior would have been

for the focus to have been set to the Code window at each

breakpoint.

8. Click on the form with the mouse.

The program should break on the first "Debug.Print" statement and

display the Code window.

9. Press F5. The program will break on the next line, but focus is

incorrectly set back to the form. Correct behavior would have been

for the focus to have been set to the Code window at each

breakpoint.

10. Press F5 again to cause the program to break on the third line.

This time it will set the focus correctly back to the Code window.

Press F5 again to cause the entire process to cycle again starting

at step 8.

Additional reference words: 1.00