private void OnHandleDestroyed(object sender, EventArgs e) { if (_filterInstalled) { Application.RemoveMessageFilter(_filter); _filterInstalled = false; _filter = null; } }
private void OnContainsFocus() { if (!_filterInstalled) { if (_filter == null) { _filter = new ComponentContainerScrollMessageFiler(this); } Application.AddMessageFilter(_filter); _filterInstalled = true; } }