protected override void OnSizeChanged(EventArgs e) { base.OnSizeChanged(e); if (this.Width == m_dxLastWidth) { return; } m_dxLastWidth = Width; // BEFORE doing anything, actions below may trigger recursive call. VectorReferenceLauncher vrl = (VectorReferenceLauncher)this.Control; VectorReferenceView view = (VectorReferenceView)vrl.MainControl; view.PerformLayout(); int h1 = view.RootBox.Height; int hNew = Math.Max(h1, ContainingDataTree.GetMinFieldHeight()) + 3; if (hNew != this.Height) { this.Height = hNew; } }
/// <summary> /// Keep the view width equal to the launcher width minus the button width. /// </summary> /// <param name="e"></param> protected override void OnSizeChanged(EventArgs e) { base.OnSizeChanged(e); if (this.m_panel != null && this.m_vectorRefView != null) { int w = this.Width - this.m_panel.Width; int h1 = RootBoxHeight; if (w < 0) { w = 0; } if (w == this.m_vectorRefView.Width) { return; // cuts down on recursive calls. } this.m_vectorRefView.Width = w; m_vectorRefView.PerformLayout(); int h2 = RootBoxHeight; CheckViewSizeChanged(h1, h2); } }