BUG: Changing Caption of Menu Item Corrupts Shortcut Key Text
ID: Q92940
|
The information in this article applies to:
-
Microsoft Visual Basic Standard and Professional Editions for MS-DOS, version 1.0
SYMPTOMS
At run time, if you change the caption property of a menu item that has a
shortcut key assigned to it, the text defining the shortcut key to the
right of the menu item is corrupted. However, the shortcut key sequence
continues to work.
WORKAROUND
To work around the problem, append CHR$(0) to the new Caption setting as
in this example:
MItem1.Caption = "First" + CHR$(0)
Or have a second menu, and set its visible property to false. Then
at run time, set the second menu's visible property to true and the first
menu's visible property to false.
STATUS
Microsoft has confirmed this to be a bug in Microsoft Visual Basic
for MS-DOS, version 1.0. We are researching this problem and will post
new information here in the Microsoft Knowledge Base as it becomes
available.
MORE INFORMATIONSteps to Reproduce Problem
- Start VBDOS.EXE.
- From the File menu select New Form... (Form1.Frm).
- From the Window menu, select Menu Design Window.
- Add a top level menu, caption = File, ctrlname = FileMnu.
- Add a sub item to the top level menu, caption = Item1,
ctrlname = MItem1. Select a Shortcut Key for this menu item from
the Shortcut Key list box.
- Exit the Menu Design Window.
- Exit the Form Designer, save all changes.
- Add the following code to the Form_Click event procedure of Form1:
SUB Form_Click()
MItem1.Caption = "First"
END SUB
- Add the following code to the MItem1_Click event procedure of the
menu item MItem1:
SUB MItem1_Click()
Print "Menu Item 1 Selected"
END SUB
- Run the application.
- Select the File menu, notice the Shortcut Key description to the
right of the menu item (Item1).
- Press the keys to activate the Shortcut key, notice that it prints
the text on the form as it should.
- Click on Form1.
- Select the menu File, notice the Shortcut Key description is now
corrupted.
- Press the keys to activate the Shortcut key as before, notice that
it still works, even though the text describing it is corrupted.
Additional query words:
VBmsdos buglist1.00 1.00
Keywords :
Version : MS-DOS:1.0
Platform : MS-DOS
Issue type :
|