protected virtual void OnTextBoxResize (object source, EventArgs e) { // compute the new height, taking the border into account Height = PreferredHeight; // let anchoring reposition the controls }