Microsoft KB Archive/180216

= PRB: Error Setting CanGetFocus Property to False =

Article ID: 180216

Article Last Modified on 11/5/2003

-

APPLIES TO


 * Microsoft Visual Basic 5.0 Learning Edition
 * Microsoft Visual Basic 5.0 Professional Edition

-



This article was previously published under Q180216



SYMPTOMS
When creating a custom ActiveX control using Microsoft Visual Basic, you get the following error when setting the CanGetFocus of the UserControl object to False:

Can't have child controls capable of receiving focus on a UserControl whose CanGetFocus property is False.



RESOLUTION
To work around this behavior, do one of the following:


 * Remove all controls that can receive focus. -or-


 * Set the UserControl's Enabled property to False instead of setting the CanGetFocus property.



STATUS
This behavior is by design.



Steps to Reproduce Behavior
 In Microsoft Visual Basic, create a new ActiveX Control project. Add a Textbox to the form. Click on the background of the UserControl to select it, and then change the CanGetFocus property from True to False. The following message will be displayed:

Can't have child controls capable of receiving focus on a UserControl whose CanGetFocus property is False.

NOTE: If you try step 3 prior to step 2, all controls in the ToolBox capable of receiving focus will be disabled so you will be unable to add the textbox.

Additional query words: kbVBp500bug kbdse kbDSupport kbVBp

Keywords: kbbug kbprb KB180216

-

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

© Microsoft Corporation. All rights reserved.