The following sample code demonstrates how to deactivate the ActiveX control during the AXHost Leave event, which allows the constituent control's LostFocus event to fire. In the sample code, axALostFocusCTL21 is the AxHost wrapper for the COM control which is placed on the Windows Form.
C# Sample Code
=============
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WindowsApplication1
{
  [ComImport(), Guid("00000113-0000-0000-C000-000000000046"),
  InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
  public interface IOleInPlaceObject
  {
     [PreserveSig]
    int GetWindow([Out]out IntPtr hwnd);
     void ContextSensitiveHelp(int fEnterMode);
     void InPlaceDeactivate();
     [PreserveSig]
     int UIDeactivate();Â
      void SetObjectRects([In] IntPtr lprcPosRect, [In] IntPtr lprcClipRect);
     void ReactivateAndUndo();Â
   }
  public partial class Form1 : Form
  {
     AxHost axControl;Â
      public Form1()
     {
        InitializeComponent();
         this.axALostFocusCTL21.Leave += new System.EventHandler(this.axALostFocusCTL21_Leave);
      }
  Â
    private void axALostFocusCTL21_Leave(object sender, System.EventArgs e)
     {
        axControl = (AxHost)sender;
        IOleInPlaceObject oipo = (IOleInPlaceObject)axControl.GetOcx();Â
        oipo.UIDeactivate();
      }
     private void Form1_FormClosing(object sender, FormClosingEventArgs e)
    {
       if(axControl != null)
       axControl.Dispose();
       if (this.axALostFocusCTL21 != null)
          this.axALostFocusCTL21.Dispose();Â
     }Â
  }
}
Visual Basic .NETÂ Sample Code
========================
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Imports System.Runtime.InteropServices
  <ComImport(), Guid("00000113-0000-0000-C000-000000000046"), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)> _
  Public Interface IOleInPlaceObjectÂ
     <PreserveSig()> _
     Sub GetWindow(<OutAttribute()> ByRef phwnd As IntPtr)
     Sub ContextSensitiveHelp(<InAttribute()> ByVal fEnterMode As Integer)Â
     Sub InPlaceDeactivate()
     <PreserveSig()> _
     Sub UIDeactivate()
     Sub SetObjectRects(<InAttribute()> ByVal lprcPosRect As IntPtr, <InAttribute()> ByVal lprcClipRect As IntPtr)
     Sub ReactivateAndUndo()
  End Interface
  Public Class Form1
     Dim axControl As AxHost
     Private Sub axALostFocusCTL21_Leave(ByVal sender As Object, ByVal e As System.EventArgs)
        axControl = CType(sender, AxHost)
       Dim oipo As IOleInPlaceObject = CType(axControl.GetOcx(), IOleInPlaceObject)
       oipo.UIDeactivate()
     End Sub
     Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        If Not axControl Is Nothing Then
           axControl.Dispose()
        End If
        If Not AxALostFocusCTL21 Is Nothing Then
           AxALostFocusCTL21.Dispose()
        End If
     End Sub
    Â
     Public Sub New()
        ' This call is required by the Windows Form Designer.
        InitializeComponent()
       ' Add any initialization after the InitializeComponent() call.
       AddHandler Me.AxALostFocusCTL21.Leave, AddressOf Me.axALostFocusCTL21_Leave
     End Sub
  End Class
MICROSOFT AND/OR ITS SUPPLIERS MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY, RELIABILITY OR ACCURACY OF THE INFORMATION CONTAINED IN THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED ON THIS WEBSITE (THE “MATERIALSâ€) FOR ANY PURPOSE. THE MATERIALS MAY INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS AND MAY BE REVISED AT ANY TIME WITHOUT NOTICE.
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND/OR ITS SUPPLIERS DISCLAIM AND EXCLUDE ALL REPRESENTATIONS, WARRANTIES, AND CONDITIONS WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO REPRESENTATIONS, WARRANTIES, OR CONDITIONS OF TITLE, NON INFRINGEMENT, SATISFACTORY CONDITION OR QUALITY, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE MATERIALS.