Microsoft KB Archive/90901

= Timer Event Suspended While Menu Is Dropped Down =

PSS ID Number: 90901

Article Last Modified on 1/9/2003

-

The information in this article applies to:


 * Microsoft Visual Basic for MS-DOS 1.0

-



This article was previously published under Q90901



SUMMARY
The events triggered by the timer control are suspended while a menu is dropped, or if there is a message box or input box on the screen.

This behavior differs from that of Microsoft Visual Basic for Windows, version 1.0.



MORE INFORMATION
In applications where it is critical that the timer interval be monitored as closely as possible, you may need to avoid menus and message boxes. If possible, when monitoring hardware or communication lines with the timer event, communications or data flow should be suspended while showing a message box or pulling down a menu.

One technique that will help in many cases with menus is to use the top-level menu click to suspend communication or stop flow of data. See the section titled &quot;Code in Top-Level Menu Click Procedures&quot; in the chapter titled &quot;Creating Menus&quot; of the Visual Basic &quot;Programmer's Guide&quot; for guidelines on what type of code can be added to a top-level menu Click event.

The following code will demonstrate the difference:

Example
To try this example in VBDOS.EXE:

 From the File menu, choose New Project. From the File menu, choose New Form. Add a timer control (Timer1) to the form. Create a top-level menu with at least one submenu. Exit FD.EXE and return to VBDOS.EXE.  Add the following code to the appropriate event procedures: SUB Form_Click Timer1.Interval = 10 Timer1.Enabled = -1 END SUB

SUB timer1_timer BEEP END SUB  Press F5 to run the program.</li> Click on the form; the beeping will start.</li> Select the menu. When it opens, the beeping will stop.</li> Close the menu; the beeping resumes.</li></ol>

Additional query words: VBmsdos 1.00

Keywords: KB90901

Technology: kbAudDeveloper kbVB100DOS kbVBSearch kbZNotKeyword3

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© 2004 Microsoft Corporation. All rights reserved.