Protected Overrides Sub OnActivated(ByVal e As System.EventArgs) MyBase.OnActivated(e) If Me.TabManagerMain IsNot Nothing Then Me.TabManagerMain.IsThisPanelActivated = True ' Property which notifies the tab manager control that it has been activated ' If the parent page group inside the tab manager is created... If Me.TabManagerMain.PageGroupSplitter1 IsNot Nothing Then ' Set focus from the top control down in the tab split tree Me.TabManagerMain.PageGroupSplitter1.SetFocusFromTopControl() End If ' Notify the active page (from the above step) to force itself to grab input focus If Me.TabManagerMain.ActivePage IsNot Nothing Then Me.TabManagerMain.ActivePage.RaiseSetFocusToMeEvent() End If ' Refresh all the tab panels since some of the drawing code may have been suspended partially above Me.TabManagerMain.RefreshAllTabPanels() End If End Sub Protected Overrides Sub OnDeactivate(ByVal e As System.EventArgs) MyBase.OnDeactivate(e) If Me.TabManagerMain IsNot Nothing Then Me.TabManagerMain.IsThisPanelActivated = False End If End Sub
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message) If m.Msg = &H1C Then ' This message (&H1C) indicates that the app went active or inactive Me._appActive = (m.WParam.ToInt32() <> 0) If Me._inputHook IsNot Nothing AndAlso My.Application.FinishedLoading Then If Me._appActive Then Me._inputHook.Start(My.Settings.EnableMouseHook, My.Settings.EnableKeyboardHook) Else Me._inputHook.Stop(True, True, False) End If End If End If MyBase.WndProc(m) End Sub