Microsoft KB Archive/236778

= BUG: Focus Events not Triggered in ActiveX Document when Using Accelerator Keys =

Article ID: 236778

Article Last Modified on 5/10/2003

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q236778



SYMPTOMS
When an ActiveX Document is hosted inside Internet Explorer, the focus events are not triggered when using accelerator keys to navigate the controls.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce
 Start a new ActiveX Document project(either DLL or EXE). Default name is "Project1" and it contains one user control "UserDocument1". Place three labels (Label1, Label2, Label3) and two Text boxes (Text1, Text2). Arrange controls so that Text1 is next to Label1 and Text2 is next to Label2. Set the order of TabIndex as Label1, Text1, Label2, Text2, Label3. Change the label caption of Label1 as Label&1 and Label2 as Label&2. Remove the caption of Label3.  Paste the following code in the UserDocument1's code: Private Sub Text1_LostFocus Label3.Caption = Label3.Caption & "Text1_LostFocus " End Sub

Private Sub Text2_GotFocus Label3.Caption = Label3.Caption & "Text2_GotFocus " End Sub </li> Run the project and start the component in UserDocument1.</li> When using the accelerator keys ALT+1 and ALT+2, the focus can shift from Text1 to Text2, but the lost_focus event of Text1 and the get_focus event of Text2 are not triggered (while TAB triggers both of those events).</li></ol>

Additional query words: ActiveX Document

Keywords: kbbug kbactivedocs kbpending KB236778

-

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

© Microsoft Corporation. All rights reserved.