The information in this article applies to:
SYMPTOMSYou create an ActiveX control that contains constituent controls, such as labels and command buttons, in Visual Basic. You assign these constituent controls access keys by including an ampersand (&) character within the Caption property. However, when you try to access one of the constituent controls using its access key, the control is not activated as expected. CAUSEThe first time you access any control on the form by using an access key, any constituent controls that are disabled or hidden at that time are excluded from what you might call a "usercontrol access key map." When one of these constituent controls later becomes enabled or visible by programmatically setting its Enabled or Visible properties to True, the "map" does not get refreshed. This causes the unexpected behavior of not being able to access the control with its access key although the control is now enabled and visible. RESOLUTIONEach time you programmatically set a constituent control's Enabled or Visible property to True, refresh its Caption property. By refreshing the constituent control's Caption property, you cause the access key mapping to include that control. See the MORE INFORMATION section for an example. STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available. MORE INFORMATIONSteps to Reproduce Behavior
WorkaroundUse the following code in place of the code for step 4 above:
Additional query words: kbDSupport kbDSD kbCtrlCreate custom control ocx accelerator hot
Keywords : kbGrpVB |
Last Reviewed: January 5, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |