Timer Event Suspended While Menu Is Dropped Down
ID: Q90901
|
The information in this article applies to:
-
Microsoft Visual Basic Standard and Professional Editions for MS-DOS, version 1.0
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 "Code in Top-Level Menu Click Procedures" in
the chapter titled "Creating Menus" of the Visual Basic "Programmer's
Guide" 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.
- Click on the form; the beeping will start.
- Select the menu. When it opens, the beeping will stop.
- Close the menu; the beeping resumes.
Additional query words:
VBmsdos 1.00
Keywords :
Version : MS-DOS:1.0
Platform : MS-DOS
Issue type :