BUG: Unable to Edit LinkNotify Event If Control Has Long Name

Last reviewed: June 21, 1995
Article ID: Q97027
The information in this article applies to:

- Standard and Professional Editions of Microsoft Visual Basic for

  Windows, version 2.0
- Microsoft Visual Basic programming system for Windows, version 1.0

SYMPTOMS

Visual Basic version 2.0 does not allow you to edit the LinkNotify event procedure of a Label, Picture Box, or Text Box control if the control has a 30-character Name property.

CAUSE

The LinkNotify event, an event new in Visual Basic version 2.0, became the longest (10 characters) event procedure name for Label, Picture Box, and Text Box controls. In version 1.0, the longest event procedure for these controls was nine characters long.

The maximum length of the Name property (CtlName property in Visual Basic version 1.0) is directly related to the length of the control's longest event procedure, so the maximum length of the Name property for Label, Picture Box, and Text Box controls in Visual Basic version 2.0 is one character less than it is in Visual Basic version 1.0.

Therefore, if you load a Visual Basic version 1.0 project into Visual Basic version 2.0 and a Label, Picture Box, or Text Box control has a 30-character CtlName property, you won't be able to edit the LinkNotify event in the Visual Basic environment until you reduce the length of the Name property.

WORKAROUND

Reduce the length of the Name property by one or more characters.

STATUS

Microsoft has confirmed this to be a bug in both the Standard and Professional Editions of Microsoft Visual Basic version 2.0 for Windows. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The maximum length of event procedures names is limited to 40 characters including the control name, the underscore, and the event name. The Name property therefore has a maximum length that varies depending on the events supported by the control.

Steps to Reproduce Problem

  1. Start Visual Basic version 1.0, or from the File menu, choose New Project (ALT, F, N) if Visual Basic is already running. Form1 is created by default.

  2. Add a Text box (Text1) to Form1.

  3. Set the CtlName property of Text1 to the following 30-character name:

    Text56789012345678901234567890

  4. From the File menu, choose Save Project (ALT, F, V). Save the form and project with their default names, Form1 and Project1.

  5. From the File menu, choose Exit to close Visual Basic version 1.0.

  6. Start Visual Basic version 2.0.

  7. From the File menu, choose Open Project (ALT, F, O) and select Project1. Two dialog boxes will appear stating that Form1 and Project1 are saved in an older format and will be saved in new format when you save the project. Choose the OK button on both dialog boxes.

  8. From the View menu, choose Code (ALT, V, C) to open a code window for Form1.

  9. From the Object List, select Text56789012345678901234567890.

  10. From the Procedures List, try to select LinkNotify.

At this point, the Visual Basic environment will not allow you to select LinkNotify. It returns you to the previously displayed event procedure.


Additional reference words: buglist2.00 1.00 2.00
KBCategory: kbenv kbbuglist
KBSubcategory: EnvtDes


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 21, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.