protected override void OnTabCountChanged(EventArgs e) { // When all the pages have been removed we kill ourself if (Pages.Count == 0) Dispose(); }