Microsoft KB Archive/169611: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
 
Line 12: Line 12:
<div id="TitleRow">
<div id="TitleRow">


= <span id="KB169611"></span>BUG: OLE AutoActivate Property Fails When Set To &quot;1 - GotFocus&quot; =
= <span id="KB169611"></span>BUG: OLE AutoActivate Property Fails When Set To "1 - GotFocus" =




Line 53: Line 53:
== SYMPTOMS ==
== SYMPTOMS ==


The Visual Basic OLE Container Control has an AutoActivate property that enables a user to activate an OLE object in different ways. Setting this property to &quot;1 - GetFocus&quot; does not automatically activate the application that provides the OLE object when the OLE container control receives the focus.
The Visual Basic OLE Container Control has an AutoActivate property that enables a user to activate an OLE object in different ways. Setting this property to "1 - GetFocus" does not automatically activate the application that provides the OLE object when the OLE container control receives the focus.


</div>
</div>
Line 60: Line 60:
== RESOLUTION ==
== RESOLUTION ==


To work around this bug, code needs to be added to the OLE Container Control's GotFocus event to automatically activate the application that provides the OLE object when the control receives the focus. The following code makes the OLE Container Control behave as though its AutoActivate property were set to &quot;1 - GotFocus&quot;:
To work around this bug, code needs to be added to the OLE Container Control's GotFocus event to automatically activate the application that provides the OLE object when the control receives the focus. The following code makes the OLE Container Control behave as though its AutoActivate property were set to "1 - GotFocus":
<pre class="codesample">  Private Sub OLE1_GotFocus()
<pre class="codesample">  Private Sub OLE1_GotFocus()
       OLE1.DoVerb (vbOLEShow)
       OLE1.DoVerb (vbOLEShow)
Line 82: Line 82:
# Start a new Standard EXE project. Form1 is added by default.
# Start a new Standard EXE project. Form1 is added by default.
# Add an OLE Container control (OLE1) to Form1 and add any OLE Object to the container control.
# Add an OLE Container control (OLE1) to Form1 and add any OLE Object to the container control.
# Set the OLE Container control's AutoActivate property to &quot;1 - GetFocus.&quot;
# Set the OLE Container control's AutoActivate property to "1 - GetFocus."
# Press the F5 key to run the program. When the OLE Container control receives focus it will not AutoActivate.
# Press the F5 key to run the program. When the OLE Container control receives focus it will not AutoActivate.


To see the behavior that should occur when the OLE Container control receives the focus, change the AutoActivate property to &quot;2 - DoubleClick&quot; and run the form or implement the workaround provided above.
To see the behavior that should occur when the OLE Container control receives the focus, change the AutoActivate property to "2 - DoubleClick" and run the form or implement the workaround provided above.


</div>
</div>
Line 92: Line 92:
== REFERENCES ==
== REFERENCES ==


For more information about the DoVerb method of OLE Container control search the on-line Help for the topic &quot;DoVerb.&quot;
For more information about the DoVerb method of OLE Container control search the on-line Help for the topic "DoVerb."


</div>
</div>

Latest revision as of 11:04, 21 July 2020

Article ID: 169611

Article Last Modified on 6/24/2004



APPLIES TO

  • Microsoft Visual Basic 5.0 Control Creation Edition
  • Microsoft Visual Basic 5.0 Learning Edition
  • Microsoft Visual Basic 6.0 Learning Edition
  • Microsoft Visual Basic 5.0 Professional Edition
  • Microsoft Visual Basic 6.0 Professional Edition
  • Microsoft Visual Basic 5.0 Enterprise Edition
  • Microsoft Visual Basic 6.0 Enterprise Edition
  • Microsoft Visual Basic 4.0 Standard Edition
  • Microsoft Visual Basic 4.0 Professional Edition
  • Microsoft Visual Basic 4.0 Enterprise Edition



This article was previously published under Q169611

SYMPTOMS

The Visual Basic OLE Container Control has an AutoActivate property that enables a user to activate an OLE object in different ways. Setting this property to "1 - GetFocus" does not automatically activate the application that provides the OLE object when the OLE container control receives the focus.

RESOLUTION

To work around this bug, code needs to be added to the OLE Container Control's GotFocus event to automatically activate the application that provides the OLE object when the control receives the focus. The following code makes the OLE Container Control behave as though its AutoActivate property were set to "1 - GotFocus":

   Private Sub OLE1_GotFocus()
      OLE1.DoVerb (vbOLEShow)
   End Sub
                

STATUS

Microsoft 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 INFORMATION

Steps to Reproduce Behavior

  1. Start a new Standard EXE project. Form1 is added by default.
  2. Add an OLE Container control (OLE1) to Form1 and add any OLE Object to the container control.
  3. Set the OLE Container control's AutoActivate property to "1 - GetFocus."
  4. Press the F5 key to run the program. When the OLE Container control receives focus it will not AutoActivate.

To see the behavior that should occur when the OLE Container control receives the focus, change the AutoActivate property to "2 - DoubleClick" and run the form or implement the workaround provided above.

REFERENCES

For more information about the DoVerb method of OLE Container control search the on-line Help for the topic "DoVerb."


Additional query words: kbole

Keywords: kbbug KB169611